-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: plan inner lookup joins on virtual column indexes in more cases #76078
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @msirek)
pkg/sql/opt/xform/testdata/rules/join, line 4144 at r1 (raw file):
# Covering case. Join on virtual column expression but do not produce it. # opt expect=GenerateLookupJoinsWithVirtualCols
[nit] is the variant with expect=
not working? Same on more testcases below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent quite some time trying to understand the column id mapping code for virtual columns and related logic, to see if there could be potential problems. I couldn't find any issues.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @mgartner and @RaduBerinde)
56b5ce5
to
55ce1dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @RaduBerinde)
pkg/sql/opt/xform/testdata/rules/join, line 4144 at r1 (raw file):
Previously, RaduBerinde wrote…
[nit] is the variant with
expect=
not working? Same on more testcases below
Nope, just something I forgot to clean up. Thanks for catching.
ExtractJoinEqualities now reuses computed columns instead of synthesizing new columns when it creates projections that exactly match a computed column expression of a base table. This allows GenerateLookupJoinsWithVirtualCols to generate lookup joins in more cases. This also paves the way for exploring anti- and semi-lookup joins on indexes with virtual columns and expression indexes. Fixes cockroachdb#75872 Release note (performance improvement): The optimizer now plans inner lookup joins using expression indexes in more cases, resulting in more efficient query plans.
55ce1dc
to
82b6db4
Compare
bors r+ |
Build succeeded: |
ExtractJoinEqualities now reuses computed columns instead of
synthesizing new columns when it creates projections that exactly match
a computed column expression of a base table. This allows
GenerateLookupJoinsWithVirtualCols to generate lookup joins in more
cases. This also paves the way for exploring anti- and semi-lookup
joins on indexes with virtual columns and expression indexes.
Fixes #75872
Release note (performance improvement): The optimizer now plans inner
lookup joins using expression indexes in more cases, resulting in more
efficient query plans.