Repository navigation
Conversation
|
Workflow [PR], commit [d963df8] Summary: ✅
AI ReviewSummaryThis PR reintroduces join lazy column indexing and changes Final VerdictStatus: ✅ Approve |
|
📊 Cloud Performance Report 🟢 AI verdict: This PR adds a join lazy-indexing optimization (hash joins emit ColumnReplicated probe-side columns plus the supporting sort/chunk plumbing), enabled by default. The intended payoff shows clearly on the join-heavy TPC-H queries Q7 (-37%) and Q20 (-50%), which is the genuine, expected win. ClickBench contains no joins, so its flagged deltas sit off the PR's code path; the +7-15% regressions there track a trending master baseline and were downgraded as drift/variance rather than real PR effects. The one exception is ClickBench Q23 (-31%), a large, consistent delta that stands on its magnitude even though the mechanism on a join-less query is unclear. clickbench🟢 1 improved · Flagged queries (9 of 43)
q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 2 improved Flagged queries (2 of 22)
q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. Debug info
|
|
Are failures in fast test related? UPD: Seems like not related, it was broken widely |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 286/302 (94.70%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 25 line(s) · Uncovered code |
2c34ffa
ColumnReplicated::permute required perm.size() == size() exactly, which is stricter than the general IColumn::permute contract. ORDER BY <LowCardinality column> LIMIT N after a LEFT JOIN with lazy column replication passes a permutation of size min(rows, limit) = LIMIT, so the check threw SIZES_OF_COLUMNS_DOESNT_MATCH (Code 9) on 26.5 and 26.3 LTS. Remove the redundant check: the underlying indexes column has the same size as the ColumnReplicated, and its permute already enforces the correct contract via getLimitForPermutation (throws when perm.size() < min(size, limit)). Master already avoids the throw by routing sortBlock through transformColumnsWithSharedIndex (ClickHouse#106566), so this is a minimal, backportable fix for the LTS branches. Regression test pins the query on master. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Remove author name and the PR ClickHouse#106566 reference from the in-file comment. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ckHouse#109877) ORDER BY a LowCardinality column with LIMIT below the row count, after a LEFT JOIN using lazy column replication, produced a permutation of size min(rows, limit) that ColumnReplicated::permute rejected with SIZES_OF_COLUMNS_DOESNT_MATCH. Fixed on master by ClickHouse#106566, which routes sortBlock through transformColumnsWithSharedIndex. This adds den-crane's minimal repro from the issue as a stateless regression test. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Reintroduces #98883 reverted in #106095.
The issue was the following:
compactReplicatedColumns(), that materializes the replicated column or removes unused rows from the underlaying data depending whether the replication is useful or not. So the same column could be replicated or not in two different chunks.FinishSortingTransformfor sorting, aColumnReplicated over a ColumnStringcan land atcompareAt()ofColumnString, leading toBad cast from type DB::ColumnReplicated to DB::ColumnString.The fix materializes sorting columns in
FinishSortingTransformsimilar to what is done inSortingTransform(1f69d10).The PR also fixes a corner case in the serialization of ColumnReplicated caught by AI review in 19ab356.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Reintroduce lazy application of selector and replication indexes in case of JOIN followed by a selective LIMIT or TopN or another JOIN. To control the number of payload columns for enabling lazy selector indexes use the setting query_plan_min_columns_for_join_lazy_indexing (0 means the optimization is disabled). To control the LIMIT for which the optimization is applied use the setting query_plan_max_limit_for_join_lazy_indexing.