Repository navigation
Conversation
…where` obsolete Both settings selected between the query plan implementation of an optimization and the legacy implementation in `InterpreterSelectQuery`. The plan-level implementations have been the default for a long time, so the legacy ones are removed and the settings are made obsolete. - Remove `ReadInOrderOptimizer` and `SelectQueryInfo::order_optimizer` together with the old-interpreter plumbing (`executeOrderOptimized`, `order_by_elements_actions`, `group_by_elements_actions`). The plan optimization is now gated by `optimize_read_in_order` alone. - Remove the AST-based `MergeTreeWhereOptimizer::optimize` and the `try_move_to_prewhere` pass of `InterpreterSelectQuery`. The plan optimization is now gated by `optimize_move_to_prewhere`, which `optimizePrewhere` already re-checks per read step. - Remove the AST side of `RPNBuilderTreeNode` and `RPNBuilderTreeContext`, leaving only `ActionsDAG` nodes. `KeyCondition::getConstant` and the `tryGetPreparedSet(DataTypes)` overload go with it. The statistics unit tests build an `ActionsDAG` via `TreeRewriter` and `ExpressionAnalyzer` instead of wrapping an AST. - Stop randomizing `query_plan_optimize_prewhere` in `clickhouse-test` and drop both settings from the tests, replacing `query_plan_optimize_prewhere = 0` with `optimize_move_to_prewhere = 0` and `query_plan_read_in_order = 0` with `optimize_read_in_order = 0`. With `query_plan_enable_optimizations = 0` the old interpreter previously still moved conditions to `PREWHERE` through the AST path; it no longer does. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Workflow [PR], commit [c3d49d4] Summary: ❌
AI ReviewSummaryThis PR removes the legacy interpreter/AST implementations behind PR Metadata
Missing context / blind spots
Findings
Tests
Final Verdict
LLVM Coverage ReportMeasured on commit c3d49d4.
Changed lines: Changed C/C++ lines covered: 232/263 (88.21%) · Uncovered code |
query_plan_read_in_order and query_plan_optimize_prewhere obsolete and remove the legacy read-in-order and PREWHERE implementations
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes148 object files changed (-215.86 KiB total), 0 added.
717 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units526 translation units recompiled, 4826 s compile time in total, 526 of them have a recent master baseline. |
The previous commit removed the legacy interpreter-level aggregation-in-order path (`group_by_elements_actions`), but `QueryPlanOptimizationSettings` still required `query_plan_aggregation_in_order = 1` to enable the query plan implementation. With the legacy path gone, `query_plan_aggregation_in_order = 0` silently turned `optimize_aggregation_in_order` into a no-op instead of selecting the legacy implementation. Make the setting obsolete, the same way as `query_plan_read_in_order` and `query_plan_optimize_prewhere`, and gate the plan optimization by `optimize_aggregation_in_order` alone. Drop the setting from BuzzHouse and from the tests that set it explicitly. Addresses review comment: ClickHouse#121390 (comment) Co-Authored-By: Claude Fable 5.1 <[email protected]>
After the AST-based index analysis path was removed, `RPNBuilderTreeContext` held nothing but a `ContextPtr`: `block_with_constants` and `prepared_sets` were only ever valid for the AST tree, and constants and sets are read from the `COLUMN` nodes of the `ActionsDAG` instead. `RPNBuilderTreeNode` now inherits from `WithContext` and carries the query context itself, so callers no longer have to keep a separate context object alive next to the node. The unused `getSettings` is dropped along with it. Co-Authored-By: Claude Opus 5 <[email protected]>
…ondition` https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121390&sha=6ecb2813189527b1a2af89ad5fc7dd0f9dae7d13&name_0=PR ClickHouse#121390 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…d-in-order-and-prewhere
It is used by the constant conversion into the index domain added in master (ClickHouse#113157). https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121390&sha=a1baeaacd53eafb1c90d18fed383604ba579c113&name_0=PR ClickHouse#121390 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`query_plan_read_in_order` is obsolete now, so it no longer switches the read-in-order gate off. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121390&sha=44780b2f9820854e6a53af089466408aa51823f3&name_0=PR&name_1=Fast%20test ClickHouse#121390 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… line in `Settings.cpp` ClickHouse#121390 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…d-in-order-and-prewhere Settings history moved inline into `DECLARE`/`MAKE_OBSOLETE` on master, so the 26.10 records for `query_plan_read_in_order`, `query_plan_optimize_prewhere` and `query_plan_aggregation_in_order` are now attached to their `MAKE_OBSOLETE` entries, together with the earlier history records from master. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…d-in-order-and-prewhere Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # src/Storages/MergeTree/MergeTreeIndexConditionText.cpp # src/Storages/MergeTree/RPNBuilder.cpp # src/Storages/MergeTree/RPNBuilder.h
6b33d32
…subcolumns Conflicts: - StorageMaterializedView.cpp, StorageMerge.cpp: master removed the legacy `order_optimizer` read-in-order path (ClickHouse#121390); kept the access-check changes. - TableFunctionMergeTreeIndex.cpp, TableFunctionMergeTreeTextIndex.cpp: master wraps `getTable` in `resolveStorageProxyLoading` (ClickHouse#121332); kept the `SHOW_TABLES` check before the lookup and the pinned metadata snapshot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Settings
query_plan_read_in_order,query_plan_optimize_prewhereandquery_plan_aggregation_in_orderare obsolete and no longer have any effect. They used to select the legacy implementations of the read-in-order, aggregation-in-order andWHEREtoPREWHEREoptimizations in the old analyzer, which were removed. Useoptimize_read_in_order,optimize_aggregation_in_orderandoptimize_move_to_prewhereto disable the corresponding optimization.Workflow [PR]
Sync PR [sync-upstream/pr/121390]
Version info
26.10.1.1234-master(included in26.10and later)