zhuqi-lucas opened a new pull request, #21213:
URL: https://github.com/apache/datafusion/pull/21213

   ## Which issue does this PR close?
   
   Related to https://github.com/apache/datafusion/issues/17348
   Precursor to https://github.com/apache/datafusion/pull/21182
   
   ## Rationale for this change
   
   Add a dedicated benchmark for sort pushdown optimization, split out from 
#21182 per reviewer request. This allows running baseline benchmarks before and 
after the optimization lands.
   
   ## What changes are included in this PR?
   
   New `sort-pushdown` benchmark subcommand with 4 queries testing sort 
elimination:
   
   | Query | Description |
   |-------|-------------|
   | Q1 | `ORDER BY l_orderkey ASC` (full scan) |
   | Q2 | `ORDER BY l_orderkey ASC LIMIT 100` |
   | Q3 | `SELECT * ORDER BY l_orderkey ASC` (wide) |
   | Q4 | `SELECT * ORDER BY l_orderkey ASC LIMIT 100` (wide) |
   
   Each query can be run with or without `--sorted` flag:
   - **Without `--sorted`**: baseline with full SortExec
   - **With `--sorted`**: declares `WITH ORDER`, enabling sort elimination
   
   ### Usage
   
   ```bash
   # Prepare data
   ./bench.sh data sort_pushdown
   
   # Baseline
   ./bench.sh run sort_pushdown
   
   # With sort elimination
   ./bench.sh run sort_pushdown_sorted
   ```
   
   ### Files Changed
   
   | File | Change |
   |------|--------|
   | `benchmarks/src/sort_pushdown.rs` | New benchmark module |
   | `benchmarks/src/lib.rs` | Register module |
   | `benchmarks/src/bin/dfbench.rs` | Register subcommand |
   | `benchmarks/bench.sh` | Add data/run entries |
   
   ## Test plan
   
   - [x] `cargo clippy -p datafusion-benchmarks` — 0 warnings
   - [x] `cargo check -p datafusion-benchmarks` — compiles
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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