Skip to content

Commit 702f479

Browse files
authored
Add ClickBench URL pushdown benchmark (#21945)
## Which issue does this PR close? N/A. This is a benchmark follow-up for #21637. ## Rationale for this change This adds a ClickBench extended query that exercises Parquet filter pushdown when row group statistics can prove a string range predicate matches every row in the row group. This case is useful for validating the optimization in #21637: when Parquet statistics prove a row group is fully matched, DataFusion can avoid evaluating the pushed-down RowFilter for that row group. ## What changes are included in this PR? - Add `benchmarks/queries/clickbench/extended/q13.sql`. - Document Q13 in the ClickBench query README. ## Are these changes tested? I ran a local synthetic-data comparison for this query. With `target_partitions=1`, the #21637 branch reduced scan processing time from about 85.82ms to 24.89ms, reduced `bytes_scanned` from 26.12M to 400.6K, and reduced `row_pushdown_eval_time` from 4.12ms to effectively zero. ## Are there any user-facing changes? No public API changes. This adds a benchmark query and benchmark documentation.
1 parent d09a919 commit 702f479

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎benchmarks/queries/clickbench/README.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,25 @@ These queries test the performance of the `FIRST_VALUE` aggregation function wit
241241
| Q12 | `WatchID` | `Int64` | `OS` | `Int16` | 91 |
242242

243243

244+
### Q13: Filter-only URL Range Match
245+
246+
**Question**: "What is the sum of counter IDs for page views with URLs in the normal URL string range?"
247+
248+
**Important Query Properties**: Filter-only string range match. The `URL`
249+
column is used only by the pushed-down filter and is not projected or
250+
aggregated. This makes the query useful for measuring optimizations that can
251+
skip RowFilter evaluation when Parquet row group statistics prove that all rows
252+
in a row group satisfy the string predicate. The output-side aggregation is
253+
intentionally lightweight so the scan-time filter evaluation cost remains
254+
visible. Run this query with Parquet filter pushdown enabled, for example
255+
`dfbench clickbench --pushdown --query 13`.
256+
257+
```sql
258+
SELECT SUM("CounterID") AS counter_id_sum
259+
FROM hits
260+
WHERE "URL" < 'zzzz';
261+
```
262+
244263

245264

246265

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- Must set for ClickBench hits_partitioned dataset. See https://github.com/apache/datafusion/issues/16591
2+
-- set datafusion.execution.parquet.binary_as_string = true
3+
4+
SELECT SUM("CounterID") AS counter_id_sum
5+
FROM hits
6+
WHERE "URL" < 'zzzz';

0 commit comments

Comments
 (0)