Skip to content

bench: add a sort_pushdown_inexact query with a page-index row selection - #27761

Open
adriangb wants to merge 1 commit into
apache:mainfrom
adriangb:bench-sort-pushdown-page-index
Open

adriangb wants to merge 1 commit into
apache:mainfrom
adriangb:bench-sort-pushdown-page-index

Conversation

@adriangb

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

No benchmark runs a TopK over a Parquet scan where the page index installs a row selection. ClickBench files have no page index, and the sort_pushdown queries have no WHERE clause. #27738 lets runtime TopK row-group pruning and statistics reordering run with a row selection. This PR adds a benchmark that exercises that path, so #27738 can rebase on it and show the effect.

What changes are included in this PR?

  • bench.sh: the sort_pushdown_inexact generator writes the page index with 64 KiB data pages. Each 100K-row RG gets about five pages.
  • queries/sort_pushdown_inexact/q5.sql: a new query that filters on 30 narrow l_orderkey ranges and runs ORDER BY l_orderkey DESC LIMIT 10.
  • README.md: documents q5 and the page index.

The query uses OR of ranges, not IN. The page index skips IN lists with more than 20 values, and 20 keys give each RG fewer rows than the LIMIT.

Metric (EXPLAIN ANALYZE) main #27738
row_groups_pruned_statistics 61 total, 38 matched 61 total, 38 matched
page_index_pages_pruned 190 total, 38 matched 190 total, 38 matched
row_groups_pruned_dynamic_filter 0 21

What is the testing strategy for this PR?

This PR only changes benchmarks. I regenerated the data with ./bench.sh data sort_pushdown_inexact and ran q5 with dfbench sort-pushdown --sorted and pushdown_filters=true. The existing queries return the same results, because the page index does not change the data.

Are there any user-facing changes?

No. Anyone with existing sort_pushdown_inexact data must delete it and regenerate it to get the page index.

🤖 Generated with Claude Code

No benchmark runs a TopK over a Parquet scan where the page index installs
a row selection. ClickBench files have no page index, and the sort_pushdown
queries have no WHERE clause. apache#27738
changes this path, so it needs a benchmark that shows the effect.

The inexact data generator now writes the page index with 64 KiB data
pages, which gives each 100K-row RG about five pages. The new q5 filters on
30 narrow l_orderkey ranges and runs ORDER BY l_orderkey DESC LIMIT 10. The
page index prunes most pages of each surviving RG. Results of the existing
queries do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant