-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
colexec: optimize CASE, AND, and OR projection operators #62925
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 3 of 3 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)
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 3 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis and @yuzefovich)
pkg/sql/colexec/and_or_projection_tmpl.go, line 170 at r1 (raw file):
o.origSel = o.origSel[:origLen] } copy(o.origSel, sel)
Should we encapsulate this pattern in a helper? 3 times is usually enough for me to pull the trigger.
Previously, in CASE, AND, and OR projection operators we would always allocate internal selection vectors of maximum capacity in the constructor. This is inefficient when the query processes only small data sets. This commit makes the allocations lazy and of tight sizes based on the batch lengths. Release note: None
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.
TFTRs!
bors r+
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @cucaroach, @jordanlewis, and @rytaft)
pkg/sql/colexec/and_or_projection_tmpl.go, line 170 at r1 (raw file):
Previously, cucaroach (Tommy Reilly) wrote…
Should we encapsulate this pattern in a helper? 3 times is usually enough for me to pull the trigger.
Good point, done.
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 r2.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @jordanlewis)
Build succeeded: |
Previously, in CASE, AND, and OR projection operators we would always
allocate internal selection vectors of maximum capacity in the
constructor. This is inefficient when the query processes only small
data sets. This commit makes the allocations lazy and of tight sizes
based on the batch lengths.
Addresses: #62212
Release note: None