cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.92k stars 3.78k forks source link

opt: improve span generation for tuple inequalities #64078

Open RaduBerinde opened 3 years ago

RaduBerinde commented 3 years ago

Currently, when we use a tuple inequality for index constraints, we keep the inequality as a remaining filter to handle NULLs correctly. For example, this is a test for idxconstraint:

index-constraints vars=(a int, b int, c int) index=(a, b, c)
(a, b, c) < (1, 2, 3)
----
(/NULL - /1/2/2]
Remaining filter: (a, b, c) < (1, 2, 3)

We can improve this to specifically exclude NULLs from the spans. In this case, we could generate:

(/NULL - /0]
(/1/NULL - /1/1]
(/1/2/NULL - /1/2/2]

Note that #64077 must be addressed before making this improvement.

Jira issue: CRDB-6882

github-actions[bot] commented 1 year ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!