Skip to content

Support cache expression filter pushdown JOIN#30

Draft
peterxcli wants to merge 10 commits into
demo-pocfrom
perf/cached-path
Draft

Support cache expression filter pushdown JOIN#30
peterxcli wants to merge 10 commits into
demo-pocfrom
perf/cached-path

Conversation

@peterxcli
Copy link
Copy Markdown
Collaborator

@peterxcli peterxcli commented Mar 13, 2026

This pull request significantly refactors and improves the query condition cache optimizer and filter logic. The main changes focus on making cache filter injection more robust and flexible, improving performance, and enhancing debuggability. The optimizer now more accurately associates cache filters with table scans, supports better statistics-based pruning, and provides improved utilities for cache key handling and introspection.

Key changes include:

Query Condition Cache Optimizer Refactor:

  • Replaced the previous single-pass optimizer walk with a two-phase approach: first collecting all LogicalGet nodes, then associating and injecting cache filters based on filter expressions and table bindings. This allows for more robust and accurate cache filter injection. [1] [2]
  • Changed the cache filter injection mechanism to use a new InjectCacheExpression method, which ensures the ROW_ID column is present and attaches the filter directly to the correct scan node. [1] [2] [3]
  • Improved handling of filter expressions by extracting table bindings and associating expressions only with the correct tables, supporting more complex query plans.

Cache Filter and Key Enhancements:

  • Updated CacheExpressionFilter to store and display its associated CacheKey, and added a ToString method for easier debugging and introspection. [1] [2]
  • Modified the filter's statistics-based pruning logic to be more accurate, only pruning when the cache indicates a row group is entirely filtered out.

Performance Improvements:

  • Optimized the filter function by adding a fast path for flat vectors, reducing overhead in common cases.

Test Adjustments:

  • Updated unit tests to construct CacheExpressionFilter with the new CacheKey parameter.

These changes collectively make the query condition cache system more robust, maintainable, and performant.

…ct metadata, and implement TPC-H benchmark script for query condition cache performance evaluation.
…on injection and improve filter propagation logic. Removed unused post-optimization function and adjusted cache filter checks in `CheckStatistics` for better performance and clarity.
@peterxcli peterxcli changed the title Perf/cached path [Demo] Support cache expression filter pushdown JOIN Mar 15, 2026
@peterxcli peterxcli marked this pull request as ready for review March 15, 2026 16:03
@peterxcli peterxcli marked this pull request as draft March 21, 2026 16:31
@peterxcli peterxcli changed the title [Demo] Support cache expression filter pushdown JOIN Support cache expression filter pushdown JOIN Apr 9, 2026
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