-
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
sql: pool some of the processor allocations #88973
Conversation
This commit cleans up the `rowSourceToPlanNode` adapter (from the DistSQL processor to the planNode object) in the following manner: - it removes the incorrect call to `ConsumerClosed` of the wrapped input. This call was redundant (because the other side of the adapter `planNodeToRowSource` does the closure too) but was also incorrect since it could access the row source that was put back into the sync.Pool (and maybe even picked up by another query). See issue 88964 for more details. - it removes the checks around non-nil "metadata forwarder". These were needed when the local planNode and DistSQL processor engines were merged into one about four years ago, but nowadays the adapter always gets a non-nil forwarder. Release note: None
4af1b13
to
141c485
Compare
This commit makes it so that we now pool allocations of noop, planNodeToRowSource, and columnarizer processors. Additionally, trailing meta callbacks for these three as well as materializers are changed to not be anonymous functions to further reduce the allocations. Release note: None
141c485
to
0ff5952
Compare
Benchmark results are similar to what we had in #88608 before I had to pull out the last commit. |
The second commit here is an extension of what we had in #88608 (pooling of |
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 2 of 2 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball)
TFTR! bors r+ |
Build succeeded: |
This commit removes a stale TODO about investigating why the materializers could not be released in all cases when they are created to wrap a row-by-row processor into the vectorized flow. The root cause was addressed in cockroachdb#88973 (the problem was that we could call `ConsumerClosed` on an already `Release`d object), so it is now safe to always release the materializers. For the same reason we no longer need to perform a deep copy of the closers when creating the materializer. Additionally, this commit removes a temporary allocation for a slice of releasables by directly modifying the main "tracking" slice. Release note: None
89628: colexec: remove a couple of now-stale TODOs r=yuzefovich a=yuzefovich This commit removes a stale TODO about investigating why the materializers could not be released in all cases when they are created to wrap a row-by-row processor into the vectorized flow. The root cause was addressed in #88973 (the problem was that we could call `ConsumerClosed` on an already `Release`d object), so it is now safe to always release the materializers. For the same reason we no longer need to perform a deep copy of the closers when creating the materializer. Additionally, this commit removes a temporary allocation for a slice of releasables by directly modifying the main "tracking" slice. Release note: None Epic: None Co-authored-by: Yahor Yuzefovich <[email protected]>
sql: clarify closing contract around plan node and row source adapters
This commit cleans up the
rowSourceToPlanNode
adapter (from theDistSQL processor to the planNode object) in the following manner:
ConsumerClosed
of the wrappedinput. This call was redundant (because the other side of the adapter
planNodeToRowSource
does the closure too) but was also incorrect sinceit could access the row source that was put back into the sync.Pool (and
maybe even picked up by another query). See issue 88964 for more details.
needed when the local planNode and DistSQL processor engines were merged
into one about four years ago, but nowadays the adapter always gets
a non-nil forwarder.
Fixes: #88964.
Release note: None
sql: pool some of the processor allocations
This commit makes it so that we now pool allocations of noop,
planNodeToRowSource, and columnarizer processors. Additionally,
trailing meta callbacks for these three as well as materializers
are changed to not be anonymous functions to further reduce the
allocations.
Fixes: #88525.
Release note: None