Repository navigation
Conversation
|
Looks like AI one-shot. You also filed 4 PRs simultaneously. Consider opening an issue instead |
|
@rienath thanks for the feedback. I've moved the full context into #116235 (measurements, repro, landing order). This PR is the manifest prune cache, fifth in that order. It caches the complete partition-candidate row vector per manifest (keyed by snapshot, manifest path, partition condition, and schema IDs), so warm queries skip the full manifest walk while min/max pruning still runs per query. I'll rebase all six onto master and update here once fork validation is green. |
Keep the manifest prune cache current with master.
…st query ids The pruner's KeyCondition is built from the full query filter, so its RPN contains UNKNOWN atoms for non-partition conjuncts and the serialized key changed with every point literal, defeating cross-literal reuse. Canonicalize the RPN with three-valued logic (UNKNOWN AND x -> x, UNKNOWN OR x -> UNKNOWN, NOT UNKNOWN -> UNKNOWN) before serializing. The stateless test now uses unique query ids per run: query_log persists on a warm server, so fixed ids matched stale rows from earlier attempts.
Replace debug-only `chassert` guards in `ManifestFilesPruner::partitionFilterHash` with real `LOGICAL_ERROR` checks on the `KeyCondition` `RPN` (`AND`/`OR`/`NOT`), so a malformed stack throws an exception in release builds instead of causing undefined behavior. Document only, no behavior change: stateless `ManifestFileIterator::create` `table_snapshot_id` placeholder, `ParquetV3BlockInputFormat` row-group key unambiguity via `path.size()`, partition-only candidate sharing between data and delete iterators, derived `StorageInMemoryMetadata` `TableStateSnapshot` equality safety under `SYSTEM CLEAR ICEBERG METADATA CACHE`, and `DatabaseDataLake::tryGetTableImpl` global-context credentials, TTL race, and `ALTER DATABASE` over-invalidation. Related: ClickHouse#116235 Related: ClickHouse#115873 Related: ClickHouse#115874 Related: ClickHouse#115876 Related: ClickHouse#115877 Related: ClickHouse#115878
Replace debug-only `chassert` guards in `ManifestFilesPruner::partitionFilterHash` with real `LOGICAL_ERROR` checks on the `KeyCondition` `RPN` (`AND`/`OR`/`NOT`), so a malformed stack throws an exception in release builds instead of causing undefined behavior. Document only, no behavior change: the stateless `ManifestFileIterator::create` `table_snapshot_id` placeholder, and why sharing one partition-candidate entry between data and delete iterators is safe. Related: ClickHouse#115876
Remove duplicate definitions and an extra brace left on the standalone branch. Serialize supported partition RPN atoms without custom Boolean rewriting. Skip candidate caching for sets and function chains: the diagnostic rendering of `IN` contains cardinality, not values. Preserve reuse across different point literals with the same partition RPN shape. Add exact-result fixtures for equal-sized sets and nested predicates; patched-binary validation remains pending.
|
Closing this draft to keep the review queue clear, per @rienath's request in #116235 to not have the whole series open at once. The manifest-candidate caching notes and the predicate-identity caveats stay in #116235. Nothing here is being pursued right now; happy to reopen as a fresh, focused PR if the team wants this piece. |
Related: #116235
Cache complete manifest partition-candidate vectors so repeated compatible predicates can skip the full manifest walk. Per-query min/max pruning still runs, and incomplete scans must not publish a candidate vector.
The latest revision removes the custom Boolean simplifier and preserves partition RPN structure. Caching is limited to predicate forms with a sufficient identity; set predicates and function chains are not cached. In particular, the diagnostic rendering of
INrecords set cardinality rather than contents and cannot safely identify a cached result. Reuse across different point literals requires the same supported partition RPN shape.The standalone branch's duplicate definitions/extra brace are corrected. New result fixtures cover equal-sized sets and nested predicates; exact-head build and cache-counter tests are queued: https://github.com/adonm/ClickHouse/actions/runs/33950833278. The fixtures passed on a baseline binary, not yet on this revision. Cancellation/concurrency and configurable cache limits remain review work. Kept draft.
Changelog category (leave one):
Changelog entry:
Reuse complete Iceberg manifest partition candidates for supported repeated partition predicates while retaining per-query min/max filtering.
Original implementation assisted by DeepSeek V4 Pro; follow-up revisions also used AI assistance.