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: add generic query plan tests with partial indexes #125871

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

mgartner
Copy link
Collaborator

Tests for generic query plans with partial indexes have been added. No
code changes are needed in order for a query with a filter like
col = $1 to utilize an index on (col) WHERE col IS NOT NULL.

Epic: CRDB-37712

Release note: None

@mgartner mgartner requested a review from a team June 18, 2024 19:08
@mgartner mgartner requested a review from a team as a code owner June 18, 2024 19:08
@mgartner mgartner requested review from DrewKimball and removed request for a team June 18, 2024 19:08
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner
Copy link
Collaborator Author

The first two comments are from #125795.

@mgartner mgartner requested review from michae2 and removed request for DrewKimball June 18, 2024 20:51
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: Nice!

Reviewed 6 of 6 files at r1, 5 of 5 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2)

@mgartner mgartner force-pushed the generic-partial-index branch from 120de4d to 31ad411 Compare June 21, 2024 22:06
Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Might also be interesting to see a case something like:

CREATE INDEX partial_idx ON t(k, i) WHERE i = k;
SELECT * FROM t WHERE k = $1 AND i = $1

Reviewed all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)

Tests for generic query plans with partial indexes have been added. No
code changes are needed in order for a query with a filter like
`col = $1` to utilize an index on `(col) WHERE col IS NOT NULL`.

Release note: None
@mgartner mgartner force-pushed the generic-partial-index branch from 31ad411 to 349ec26 Compare June 24, 2024 14:43
@mgartner mgartner requested a review from DrewKimball June 24, 2024 14:43
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.

I added a test like that. It seems to work well.

TFTRs!

bors r+

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

@craig craig bot merged commit afe9485 into cockroachdb:master Jun 24, 2024
21 of 22 checks passed
@mgartner mgartner deleted the generic-partial-index branch June 24, 2024 15:21
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.

4 participants