opt: generate semi and anti inverted joins on multi-column indexes#58054
Conversation
rytaft
left a comment
There was a problem hiding this comment.
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
mgartner
left a comment
There was a problem hiding this comment.
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
ConvertSemiToInnerJoinis actually necessary here. We should probably get rid of that rule at some point (although I think we need to do some more work inGenerateLookupJoinsfirst).
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
rytaft
left a comment
There was a problem hiding this comment.
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
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
mgartner
left a comment
There was a problem hiding this comment.
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!
rytaft
left a comment
There was a problem hiding this comment.
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
ConstFiltersfield was added toInvertedJoinPrivate, similar toLookupJoinPrivateso 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