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 test constraining partial index on virtual column #60601

Merged

Conversation

mgartner
Copy link
Collaborator

No code changes were necessary in order to generate a constrained scan
for a partial index on a virtual column.

Release note: None

@mgartner mgartner requested a review from a team as a code owner February 16, 2021 01:12
@cockroach-teamcity
Copy link
Member

This change is Reviewable

# the predicate.
# TODO(mgartner): Teach indexConstraintCtx.simplifyFilter to remove b=140 from
# the remaining filters after the index constraint is built. This will eliminate
# the unnecessary index-join and select expressions.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added this limitation to #57608 to track.

Copy link
Collaborator

@rytaft rytaft 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 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @RaduBerinde)


pkg/sql/opt/xform/testdata/rules/select, line 1726 at r1 (raw file):


# Regression test for #55387. GenerateConstrainedScans should not reduce the
# input filters when proving partial index implication.

Did you mean to remove this comment?

@mgartner mgartner force-pushed the constrained-partial-index-virtual branch from 28f268f to 169afb8 Compare February 16, 2021 21:52
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 @RaduBerinde and @rytaft)


pkg/sql/opt/xform/testdata/rules/select, line 1726 at r1 (raw file):

Previously, rytaft (Rebecca Taft) wrote…

Did you mean to remove this comment?

Nope! Fixed.

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

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


pkg/sql/opt/xform/testdata/rules/select, line 1736 at r2 (raw file):

# the unnecessary index-join and select expressions.
opt
SELECT k FROM virtual WHERE c = 150

Can you add a test with WHERE b = 140?

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @mgartner)

@mgartner mgartner force-pushed the constrained-partial-index-virtual branch from 169afb8 to 7c3275f Compare February 17, 2021 00:08
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 2 stale) (waiting on @rytaft)


pkg/sql/opt/xform/testdata/rules/select, line 1736 at r2 (raw file):

Previously, RaduBerinde wrote…

Can you add a test with WHERE b = 140?

Done. It suffers from the same limitation of simplifyFilter.

Copy link
Member

@RaduBerinde RaduBerinde 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 1 of 1 files at r3.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)

@mgartner mgartner force-pushed the constrained-partial-index-virtual branch 2 times, most recently from 6a5c99c to 09134da Compare February 17, 2021 17:15
@mgartner
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 17, 2021

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Feb 17, 2021

Build failed:

No code changes were necessary in order to generate a constrained scan
for a partial index on a virtual column.

Release note: None
@mgartner mgartner force-pushed the constrained-partial-index-virtual branch from 09134da to 2d2c867 Compare February 18, 2021 18:59
@mgartner
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 18, 2021

Build succeeded:

@craig craig bot merged commit 40a35fe into cockroachdb:master Feb 18, 2021
@mgartner mgartner deleted the constrained-partial-index-virtual branch February 18, 2021 23:00
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