Turn on enable_join_transitive_predicates by default#103724
Conversation
| SELECT * FROM t1 ALL INNER JOIN tj ON t1.key1 = tj.key1 AND t1.key2 = tj.key2 AND t1.key3 = tj.key3 AND t1.key1 = tj.key1 SETTINGS enable_join_transitive_predicates = 0; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } | ||
|
|
||
| SELECT '--- duplicated predicate removed ---'; | ||
| SELECT * FROM t1 ALL INNER JOIN tj ON t1.key1 = tj.key1 AND t1.key2 = tj.key2 AND t1.key3 = tj.key3 AND t1.key1 = tj.key1 SETTINGS enable_analyzer = 1, enable_join_transitive_predicates = 1, query_plan_optimize_join_order_limit = 10; |
There was a problem hiding this comment.
This test still forces enable_join_transitive_predicates = 1, so it does not actually verify the PR's main behavior change (the new default). If someone accidentally flips the default back to false, this test would continue to pass.
Please add a case that relies on the default value (no explicit enable_join_transitive_predicates override) and validates the query succeeds under that default.
|
Hi @davenger, should we also update https://clickhouse.com/docs/operations/settings/settings#enable_join_transitive_predicates to remove experimental flag? |
|
📊 Cloud Performance Report 🟢 AI verdict: This PR turns on the join-transitive-predicates optimizer setting by default. The two TPC-H join queries (Q7 -31.9%, Q20 -45.1%) show large, consistent speedups that match the change directly: the optimizer can now infer extra join predicates and pick better join orders. The three flagged ClickBench improvements (Q15, Q32, Q34) run against a single flat table with no joins, so this PR cannot plausibly affect them; those deltas are run-to-run variance and were downgraded. Net: a real join-planning win on multi-table workloads, no regressions. clickbenchFlagged queries (3 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
|
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 17/17 (100.00%) | Lost baseline coverage: none · Uncovered code |

Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Turn on
enable_join_transitive_predicatesby defaultDocumentation entry for user-facing changes
Version info
26.6.1.566