Repository navigation
Revert "Join reordering: FK->PK heuristic for equi joins without NDV statistics" - #120923
Conversation
| INSERT INTO ta SELECT number FROM numbers(100); | ||
| INSERT INTO tb SELECT number FROM numbers(100); | ||
| INSERT INTO tc SELECT number FROM numbers(10); | ||
|
|
There was a problem hiding this comment.
This revert keeps the greedy planner's non-equi connectivity handling: GreedyJoinOrderOptimizer::solve still treats a pair as connected as soon as getApplicableExpressions returns cross-side predicates, so the ta/tb/tc range-join case remains a valid invariant of the current optimizer. Deleting this test broadens the rollback beyond the stated FK->PK/no-stats heuristic and drops the only focused coverage I could find for "prefer the range-connected pair over a bare cross product". Please keep this test or re-add an equivalent greedy regression case.
Clears the stale `Build (arm_tidy)` failure on this pull request: it was a duplicate `#include <IO/VarInt.h>` in `src/Core/tests/gtest_settings.cpp`, unrelated to the revert and already removed on master by 4137c11. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Merged The only red job here was Independent confirmation on
So the revert restores the 0.3 s steady state, while #120762 removes the hard failure but leaves Q5 about 5x slower than before #120176 - which is the argument for landing the revert now and re-landing the heuristic on top of the costing fix. Still reproducing on PR runs today, e.g. https://s3.amazonaws.com/clickhouse-test-reports/PRs/108550/0d2109d9c2c0cc61f4a3e3f5de395f968a1fed81/pr/performance_comparison_arm_release_master_head_5_6/report.html (#108550, which does not touch joins). Over the last two days |
Reverts #120176.
Since that merge (2026-09-17 22:33 UTC), every master run of
Performance Comparison (amd_release, master_head, 2/6)that samplesiceberg_suite_tpchquery 4 (TPC-H Q5 over the CI Iceberg dataset) fails with10 errors: the query hits the runner's 15 smax_execution_timeon its first measured run, right after a 1.6 s prewarm on the same server. It ran in ~350 ms before. On 2026-09-18, 16 of 24 master runs of that shard failed, and PR runs fail the same way, for example https://s3.amazonaws.com/clickhouse-test-reports/PRs/120677/292397793c01e430db3c87625724c3a9d94b4610/pr/performance_comparison_amd_release_master_head_2_6/report.html.Root cause, repro with the public dataset and CI binaries, and notes for re-landing the heuristic are in the linked issue. In short:
ReadFromObjectStorageStephas no row estimate, so after the prewarm run only two leaves get row counts from the hash-table statistics cache. The new cost model then treats the one relation with a known size as the most expensive thing to join, starts with the many-to-manycustomer ⋈ supplieronnationkey, estimates the resulting blob at 1 row (one side unknown, other sideregion[1]), and builds it as the hash table.This is a plain
git revert -m 1of the merge commit, so the master perf CI is green again while the heuristic is reworked for relations without row estimates.Closes: #120921
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/120923]
Version info
26.10.1.205(included in26.10and later)