Skip to content

Commit 17b53c5

Browse files
docs: add feature flag info for unique constraints as query hints (FIR-49236) (#1108)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>
1 parent a3a9f19 commit 17b53c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs-mdx/performance-and-observability/query-planning/unique-constraint.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ title: UNIQUE constraints as query hints
66

77
In Firebolt, `UNIQUE` constraints can be declared in `CREATE TABLE` statements. However, the system does not enforce data uniqueness. The query optimizer uses these hints to make better decisions during query planning and optimization.
88

9+
<Note>
10+
Using UNIQUE constraints as query hints is an opt-in feature. To enable it, run the following command:
11+
```sql
12+
SET lqp2_derive_ndv_from_unique_keys = true;
13+
```
14+
</Note>
15+
916
Data uniqueness is a crucial piece of information for the query optimizer. In Firebolt, it mainly affects query plan quality through two aspects:
1017

1118
1. **Plan transformation** -- Enables more effective plan rewrites when unique keys are present.

0 commit comments

Comments
 (0)