-
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: generate semi and anti inverted joins on multi-column indexes #58054
opt: generate semi and anti inverted joins on multi-column indexes #58054
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.
Reviewed 4 of 4 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
pkg/sql/opt/xform/testdata/rules/join, line 5349 at r1 (raw file):
# Generate an inverted semi join on a multi-column inverted index. opt expect=(GenerateInvertedJoinsFromSelect,ConvertSemiToInnerJoin)
[nit] I don't think ConvertSemiToInnerJoin
is actually necessary here. We should probably get rid of that rule at some point (although I think we need to do some more work in GenerateLookupJoins
first).
1f5ef5e
to
24bad8e
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 1 stale) (waiting on @rytaft)
pkg/sql/opt/xform/testdata/rules/join, line 5349 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
[nit] I don't think
ConvertSemiToInnerJoin
is actually necessary here. We should probably get rid of that rule at some point (although I think we need to do some more work inGenerateLookupJoins
first).
Done. I saw it here so I thought it might be important for inverted semi joins:
cockroach/pkg/sql/opt/xform/testdata/rules/join
Line 4879 in fa312ba
opt expect=(GenerateInvertedJoins,ConvertSemiToInnerJoin) |
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.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @mgartner)
pkg/sql/opt/xform/testdata/rules/join, line 5349 at r1 (raw file):
Previously, mgartner (Marcus Gartner) wrote…
Done. I saw it here so I thought it might be important for inverted semi joins:
cockroach/pkg/sql/opt/xform/testdata/rules/join
Line 4879 in fa312ba
opt expect=(GenerateInvertedJoins,ConvertSemiToInnerJoin)
Yea, that was probably left over from before Sumeer made the change to support semi joins directly with the paired joins.
This commit adds tests for generating semi and anti inverted joins on multi-column inverted indexes. A `ConstFilters` field was added to `InvertedJoinPrivate`, similar to `LookupJoinPrivate` so that row count estimates for these expressions are more accurate. This was necessary to make the semi and anti joins the chosen plans for the exploration tests. A future commit will add more comprehensive stats tests. Release note: None
24bad8e
to
b047276
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 1 stale) (waiting on @rytaft)
pkg/sql/opt/xform/testdata/rules/join, line 5349 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
Yea, that was probably left over from before Sumeer made the change to support semi joins directly with the paired joins.
Ok. I've removed it too!
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.
Reviewed 1 of 1 files at r3.
Reviewable status: complete! 1 of 0 LGTMs obtained
TFTR! bors r=rytaft |
Build succeeded: |
The statistics builder was updated in cockroachdb#58054 to consider constant filters on non-inverted prefix columns when building stats for multi-column inverted joins. This commit adds additional tests for this. There is no release note because multi-column inverted indexes are gated behind the `experimental_enable_multi_column_inverted_indexes` session setting. Release note: None
58495: ui: changed metric label CPUs to vCPUs r=nanduu04 a=nanduu04 Release note (ui change): CPUs metric column renamed to vCPUs in node overview in cluster overview page. 59171: opt: build stats and logical props for multi-column inverted joins r=rytaft a=mgartner #### opt: add stats tests for multi-column inverted joins The statistics builder was updated in #58054 to consider constant filters on non-inverted prefix columns when building stats for multi-column inverted joins. This commit adds additional tests for this. There is no release note because multi-column inverted indexes are gated behind the `experimental_enable_multi_column_inverted_indexes` session setting. Release note: None #### opt: consider inverted join prefix key columns when building logical props This commit updates the logical props builder to consider inverted join prefix key columns when building logical props for inverted join expressions. There is no release note because multi-column inverted indexes are gated behind the `experimental_enable_multi_column_inverted_indexes` session setting. Release note: None Co-authored-by: Nandu Pokhrel <nandup@cockroachlabs.com> Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
This commit adds tests for generating semi and anti inverted joins on
multi-column inverted indexes. A
ConstFilters
field was added toInvertedJoinPrivate
, similar toLookupJoinPrivate
so that row countestimates for these expressions are more accurate. This was necessary to
make the semi and anti joins the chosen plans for the exploration tests.
A future commit will add more comprehensive stats tests.
Release note: None