zhuqi-lucas commented on PR #21182:
URL: https://github.com/apache/datafusion/pull/21182#issuecomment-4159357100

   @adriangb That's expected! The TPC-H/TPC-DS benchmarks don't have `WITH 
ORDER` declared and the data files aren't pre-sorted, so sort elimination 
doesn't trigger — "no change" confirms there's no regression.
   
   The optimization kicks in when:
   1. Files have `WITH ORDER` (or Parquet `sorting_columns` metadata from 
writing sorted data)
   2. Files within each group are non-overlapping (verified via min/max 
statistics)
   
   The dedicated `sort-pushdown` benchmark (merged in #21213) tests this 
scenario specifically:
   
   ```
   Query | Description          | Baseline (ms) | Optimized (ms) | Speedup
   ------|----------------------|---------------|----------------|--------
   Q1    | ASC full scan        |        251    |         133    |  47%
   Q2    | ASC LIMIT 100        |         24    |           8    |  66%
   Q3    | SELECT * ORDER BY    |        689    |         478    |  31%
   Q4    | SELECT * LIMIT 100   |         67    |          18    |  73%
   ```
   
   To run it: `dfbench sort-pushdown --sorted --path <tpch_data> --queries-path 
benchmarks/queries/sort_pushdown`


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