parthchandra opened a new issue, #7853: URL: https://github.com/apache/datafusion-comet/issues/7853
`SortInputCoalesceExec` (#7696) passes batches through unchanged until a task's sort input reaches the sort's in-place threshold (`sort_in_place_threshold_bytes`, 1 MiB by default). Only batches after that point are combined. This keeps sorts that stay under the threshold free of any cost, which is the case that regressed in #5686's first attempt. The batches before the gate still reach the sort one at a time, so the sort merges one stream for each of them. **Proposal:** hold the batches before the gate without copying them, and reserve what they keep alive. If the input ends under the threshold, hand them to the sort unchanged. If it crosses the threshold, combine them along with the rest. **To check:** - Memory: the held batches are reserved in a consumer that cannot spill, so the same fair-share limit as in `a_combined_batch_can_exceed_a_share_the_raw_batches_fit` applies. - Cost: input under the threshold should stay as fast as today. Measure it with #5686's 128 x 128 stage timing. - Gain: the merge fan-in saved is at most the threshold's worth of batches per task, so measure it with `sort_small_batches` at 16 to 64 rows per batch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
