Repository navigation
Add a performance test for dictionary-based row group filtering in Parquet - #120834
Merged
Merged
Conversation
…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]>
Contributor
|
Workflow [PR], commit [d3c5e9a] Summary: ✅
AI ReviewSummaryAdds a focused performance regression guard for dictionary-based row-group pruning in the Final VerdictStatus: ✅ Approve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a performance test for dictionary-based row group filtering in the
Parquetreader (input_format_parquet_dictionary_filter_push_down, added in #106952 and re-landed in #110567). For an equality orINcondition 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 intests/performancecovered this path.The fixture puts the reader in the situation the feature was written for, the one a real
hits.parquetis in:modelis a low-cardinality string column whose values are spread over the whole file, sozzz...value occur in every row group, so every row group's range spans every value searched for, andoutput_format_parquet_write_bloom_filter = 0turns 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), withinput_format_parquet_dictionary_filter_push_downoff and on:count(), value in 30 of 300 row groupscount(), value in no row groupcount(),INover both of themsum()of another column, same conditioncount(), value in every row groupThe 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.pyagainst 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):
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
Parquetreader.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/120834]
Version info
26.10.1.260-master(included in26.10and later)