Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt: generate constrained scans for indexed, boolean expressions #114798

Merged

Conversation

mgartner
Copy link
Collaborator

Prior to this commit, the optimizer would not generate constrained scans
for all indexed, boolean computed expressions. This limitation has been
lifted.

Fixes #114078

Release note (performance improvement): The optimizer now generates
constrained scans on indexes containing boolean, computed expressions.

@mgartner mgartner requested a review from a team November 21, 2023 14:29
@mgartner mgartner requested a review from a team as a code owner November 21, 2023 14:29
@mgartner mgartner requested review from DrewKimball and removed request for a team November 21, 2023 14:29
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)


pkg/sql/opt/idxconstraint/testdata/computed line 43 at r1 (raw file):

----
[/false - /false]

Can you also add an optimizer test to show a constrained scan being generated?

@mgartner mgartner force-pushed the 114078-boolean-indexed-expressions branch from 0045bab to 971ddbe Compare January 4, 2024 21:22
Copy link
Collaborator Author

@mgartner mgartner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)


pkg/sql/opt/idxconstraint/testdata/computed line 43 at r1 (raw file):

Previously, DrewKimball (Drew Kimball) wrote…

Can you also add an optimizer test to show a constrained scan being generated?

Done.

Prior to this commit, the optimizer would not generate constrained scans
for all indexed, boolean computed expressions. This limitation has been
lifted.

Fixes cockroachdb#114078

Release note (performance improvement): The optimizer now generates
constrained scans on indexes containing boolean, computed expressions.
@mgartner mgartner force-pushed the 114078-boolean-indexed-expressions branch from 971ddbe to 83aa7b6 Compare January 4, 2024 23:33
@mgartner
Copy link
Collaborator Author

mgartner commented Jan 5, 2024

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 5, 2024

Build succeeded:

@craig craig bot merged commit 80adb49 into cockroachdb:master Jan 5, 2024
9 checks passed
@mgartner mgartner deleted the 114078-boolean-indexed-expressions branch January 5, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query unable to use expression index that coalesces nulls
3 participants