zhuqi-lucas commented on code in PR #21182:
URL: https://github.com/apache/datafusion/pull/21182#discussion_r3036553365


##########
datafusion/physical-plan/src/sorts/sort_preserving_merge.rs:
##########
@@ -366,7 +366,7 @@ impl ExecutionPlan for SortPreservingMergeExec {
                     .map(|partition| {
                         let stream =
                             self.input.execute(partition, 
Arc::clone(&context))?;
-                        Ok(spawn_buffered(stream, 1))
+                        Ok(spawn_buffered(stream, 16))

Review Comment:
   Thanks @Dandandan! Great points.
   
     1. Agreed on naming — "buffering" is more accurate than "prefetching".
     2. Using BufferExec is a much cleaner approach — it already has byte-based 
capacity control and MemoryPool integration, which is better than the 
batch-count-based spawn_buffered approach. I'll update to insert a BufferExec 
between SPM and DataSourceExec when eliminating SortExec, instead of modifying 
SPM's internal buffer.
     3. Created a follow-up issue for parallel merge: 
[#21381](https://github.com/apache/datafusion/issues/21381) — great idea, this 
would especially help when sort elimination makes SPM directly I/O-bound.



-- 
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]

Reply via email to