zhuqi-lucas commented on PR #21182: URL: https://github.com/apache/datafusion/pull/21182#issuecomment-4181576362
> #20362 (comment) Thanks for the try, got it, let me investigate more for this PR solution, there are trade offs which are complex. Quick update on what I found locally (release build, default 12 partitions): **Plans ARE different:** - Main: `SPM → SortExec(pp=true) → DataSourceExec(12 groups)` - PR: `SPM → DataSourceExec(12 groups, output_ordering)` PR eliminates SortExec and reorders files within cross-file groups (e.g., `[b_head, a_tail]` instead of `[a_tail, b_head]`), making each partition sorted. **Q1/Q3 slower**: each partition's data is already sorted, so SortExec on main is essentially a pass-through (detects sorted input, outputs as-is). Removing it saves nothing but we still pay for SPM's 12-way merge overhead. Investigating whether we can avoid this trade-off. **Q2/Q4 faster**: sort elimination + fetch/LIMIT pushdown → reads only ~100 rows then stops. -- 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]
