Skip to content

Add a performance test for dictionary-based row group filtering in Parquet - #120834

Merged
alexey-milovidov merged 2 commits into
masterfrom
parquet-dictionary-filter-perf-test
Sep 20, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
parquet-dictionary-filter-perf-test

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Adds a performance test for dictionary-based row group filtering in the Parquet reader (input_format_parquet_dictionary_filter_push_down, added in #106952 and re-landed in #110567). For an equality or IN condition on a fully dictionary-encoded column chunk the reader reads the dictionary page and skips the whole row group when it holds none of the values searched for. Nothing in tests/performance covered this path.

The fixture puts the reader in the situation the feature was written for, the one a real hits.parquet is in: model is a low-cardinality string column whose values are spread over the whole file, so

  • min/max statistics prune nothing — an empty string and a zzz... value occur in every row group, so every row group's range spans every value searched for, and
  • there are no bloom filters, which is what most Parquet writers produce; output_format_parquet_write_bloom_filter = 0 turns off the ones ClickHouse would write.

The dictionary page is then the only per-row-group structure that can rule a value out.

Measured locally on the fixture the test builds (300M rows, 300 row groups, max_threads = 1), with input_format_parquet_dictionary_filter_push_down off and on:

query off on rows read
count(), value in 30 of 300 row groups 0.401s 0.040s 300M → 30M
count(), value in no row group 0.393s 0.004s 300M → 0
count(), IN over both of them 1.107s 0.118s 300M → 30M
sum() of another column, same condition 0.060s 0.013s
count(), value in every row group 0.421s 0.426s 300M → 300M

The last query is the counterweight: nothing can be skipped there, so the dictionary pages are read and hashed for nothing and the query must not become slower.

Validated with tests/performance/scripts/perf.py against two servers: the fill takes about 9 s per server, all measured runs together about 10 s, and an A/A run reports no change on any of the five queries (per-run times vary by less than 1%).

Related: #106952
Related: #110567

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add a performance test for dictionary-based row group filtering in the Parquet reader.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/120834]

Version info

  • Merged into: 26.10.1.260-master (included in 26.10 and later)

…rquet

`input_format_parquet_dictionary_filter_push_down` (#106952, re-landed in
#110567) lets the `Parquet` reader skip a whole row group for an equality or
`IN` condition when the column chunk is fully dictionary-encoded and its
dictionary page holds none of the values that are searched for. Nothing in
`tests/performance` covered it.

The fixture puts the reader in the situation the feature was written for, the
one a real `hits.parquet` is in: a low-cardinality string column whose values
are spread over the whole file, so min/max statistics prune nothing (every row
group's range spans every value searched for), and no bloom filters, which is
what most Parquet writers produce. The dictionary page is then the only
per-row-group structure that can rule a value out.

Measured locally on the fixture the test builds, at `max_threads = 1`, with
`input_format_parquet_dictionary_filter_push_down` off and on:

    query                                            off       on   rows read
    count(), value in 30 of 300 row groups        0.401s   0.040s   300M -> 30M
    count(), value in no row group                0.393s   0.004s   300M -> 0
    count(), IN over both of them                 1.107s   0.118s   300M -> 30M
    sum() of another column, same condition       0.060s   0.013s
    count(), value in every row group             0.421s   0.426s   300M -> 300M

The last query is the counterweight: nothing can be skipped there, so the
dictionary pages are read and hashed for nothing and the query must not become
slower.

Co-Authored-By: Claude Opus 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d3c5e9a]

Summary: ✅


AI Review

Summary

Adds a focused performance regression guard for dictionary-based row-group pruning in the Parquet reader. I did not find a correctness, robustness, or PR-metadata issue in the current version of the test.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-build Pull request with build/testing/packaging improvement comp-testing Test content only (no production code). labels Sep 18, 2026
@alexey-milovidov alexey-milovidov self-assigned this Sep 20, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 20, 2026
Merged via the queue into master with commit 10e9b71 Sep 20, 2026
177 checks passed
@alexey-milovidov
alexey-milovidov deleted the parquet-dictionary-filter-perf-test branch September 20, 2026 03:17
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 20, 2026
@clickhouse-gh clickhouse-gh Bot added comp-parquet-reader-v3 Issues related to the native Parquet reader. and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-parquet-reader-v3 Issues related to the native Parquet reader. pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants