Open RaduBerinde opened 5 years 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 5 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
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!
We have separate, similar logic for deriving constraints and index constraints. The index constraints code is more powerful and can deduce more FDs in various cases. This leads to logical property mismatch which can be problematic.
For example, if a constrain scan knows a column is constant but an IndexJoin on top of it does not (because it lives in the group that was created from a Select), it can cause problems with orderings (the Scan doesn't provide an ordering on the constant column).
We should move most of the smartness into the constraints library, and derive index constraints from the constraints (possibly with a limited set of additional checks that can be determined to not cause differences in logical properties).
Jira issue: CRDB-4754