Open maryliag opened 3 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 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
Currently, CHECK constraints are not being take into consideration for optimization, for example:
create table users (age int, check (age > 0 and age < 150));
And then try to select with a value that is not possible, such as
select * from users where age=200
Checking with the explain option, we can see that is doing a
FULL SCAN
, even though we won't find any values.If the constraint is validated, it should be able to detect the contradiction and convert that scan to a zero values node.
Jira issue: CRDB-6430