Repository navigation
Preserve dictionary identity through ColumnArray::cut - #115961
alexey-milovidov merged 2 commits into
Conversation
|
Workflow [PR], commit [aa3a595] Summary: ✅
AI ReviewSummaryThis PR teaches Final Verdict✅ No blocking findings on the current head. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 63/64 (98.44%) · Uncovered code |
062f41d to
1a34752
Compare
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units8 translation units recompiled, 11 s compile time in total, 8 of them have a recent master baseline. |
|
📊 Cloud Performance Report ✅ AI verdict: Release-transition baseline: compared against the last 26.8 master because no 26.9 master baseline exists at or before the trusted base-commit anchor. no significant changes detected. K_source=6 K_base=2 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
1a34752 to
00d8057
Compare
00d8057 to
a5ca6d4
Compare
|
I pushed a fix for |
…cast The test asserts that two queries publish a shared fixed-hash-table JOIN runtime filter. Under randomized settings the assertion could see zero instead: with `query_plan_optimize_join_order_randomize` on, the join order optimizer works from random cardinalities and can put the small table on the probe side, and with `query_plan_join_swap_table` pinned to `false` the sides cannot be swapped back. The estimated probe size then falls below `join_runtime_filter_min_probe_rows` and no runtime filter is created at all, which is not what the test is about. Set `join_runtime_filter_min_probe_rows` to 0 in the test so the filter is always created regardless of the chosen plan shape. Verified locally over the whole `query_plan_join_swap_table` x `query_plan_optimize_join_order_randomize` matrix, including the exact settings from the failed run, plus 20 runs with fully randomized settings. Also fix the leftover `04613_` prefix in the `log_comment` values, which no longer matches the test's own number. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115961&sha=1a3475209c5db937dae51192124325b1a22a17b3&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 Related: ClickHouse#115961 Co-Authored-By: Claude Fable 5 <[email protected]>
Baseline: * Plain: 0.556s * LowCardinality: 0.867s
It already happens in `ColumnLowCardinality::cut`. Benchmark results: * ARRAY JOIN: 0.8623s -> 0.7042s (-18.3%) * Flat control: 0.5579s -> 0.5603s (+0.4%, noise) * Relative ARRAY JOIN overhead: 54.6% -> 25.7% * Absolute overhead reduced by 52.8%
e4d0901 to
aa3a595
Compare
|
I fixed the newly flagged bot issue + rebased on top of the latest |
Shared dictionaries from Native input can contain signed zero and multiple NaN payloads. Avoid sharing floating-point dictionaries so `ColumnUnique` canonicalizes these values during different-dictionary insertion. This is a regression from: ClickHouse#115961
Shared dictionaries from Native input can contain signed zero and multiple NaN payloads. Avoid sharing floating-point dictionaries so `ColumnUnique` canonicalizes these values during different-dictionary insertion. This is a regression from: ClickHouse#115961
Shared dictionaries reconstructed from on-disk `LowCardinality` dictionary streams can contain signed zero and multiple NaN payloads. Avoid sharing floating-point dictionaries so `ColumnUnique` canonicalizes these values during different-dictionary insertion. This is a regression from: ClickHouse#115961
Shared dictionaries reconstructed from on-disk `LowCardinality` dictionary streams can contain signed zero and multiple NaN payloads. Avoid sharing floating-point dictionaries so `ColumnUnique` canonicalizes these values during different-dictionary insertion. This is a regression from: ClickHouse#115961
Shared dictionaries reconstructed from on-disk `LowCardinality` dictionary streams can contain signed zero and multiple NaN payloads. Avoid sharing floating-point dictionaries so `ColumnUnique` canonicalizes these values during different-dictionary insertion. This is a regression from: ClickHouse#115961
Shared dictionaries reconstructed from on-disk `LowCardinality` dictionary streams can contain signed zero and multiple NaN payloads. Avoid sharing floating-point dictionaries so `ColumnUnique` canonicalizes these values during different-dictionary insertion. This is a regression from: ClickHouse#115961
Since ClickHouse#107189 the hash join emits consecutive same-block rows of a key with one `insertRangeFrom` instead of one `insertFrom` per row. `RowRefList` keeps a key's rows in nodes of up to 6 refs, so these runs are 2-6 rows long. When the source block's dictionary differs from the output column's, `ColumnLowCardinality::insertRangeFrom` builds about five temporary columns per call whatever the length (`cut`, `mapUniqueIndex`, `index` of the used keys, `uniqueInsertRangeFrom`, `index` of the positions), so such a run costs ~25x per row what `insertFrom` costs. ClickHouse#115961 avoids it only when the right side has a single shared dictionary; several parts, `FINAL` or a `LowCardinality` value computed per block still hit it on every run. Ranges of at most 32 rows from a different dictionary are now translated row by row with the per-key rules of `uniqueInsertRangeImpl`: the source NULL maps to the destination NULL, a key that compares equal to the default (so `-0.0` too) maps to the default slot, anything else goes through `uniqueInsertFrom`, which canonicalizes NaN. Positions are computed before the indexes change and the range is bounds-checked first, so a throw leaves the rows untouched, as on the range path. The threshold is the largest power of two at which the per-row path is not slower than the range path in a microbenchmark of ns per call (RelWithDebInfo, one core, median of 7): range/per-row at 32 rows is 1.99x for 7 short keys, 2.52x for 10000 random keys, 1.48x for two 200-byte keys and 3.61x for 1000 UInt64 keys; at 64 the 200-byte case drops to 0.87x. A/B, RelWithDebInfo, n = 10 interleaved, medians (26.6.8.7 / parent / this): issue repro 4 with `compatibility = '23.8'` 2.31 / 8.93 / 2.30 s; repro 1 with the table in 4 parts 1.33 / 5.12 / 0.79 s, at default settings 1.00 / 4.40 / 0.50 s; a table-free `hash` join 0.18 / 0.75 / 0.15 s. Shared-dictionary and `String` controls unchanged. Repro 4 at default settings does not reach this path (the join sides are swapped and the time is in the row-store emit). The gtest compares a short range against a 600-row range of the same rows for every length 1-256; it fails when the default fold, the bounds check or the NULL branch is removed. Closes: ClickHouse#123874 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was originally a part of #114993, but it works as a standalone improvement just as well.
It already happens in
ColumnLowCardinality::cut. Benchmark results:Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Speed up
Array(LowCardinality(T))aggregations by preserving dictionary identity.Workflow [PR]
Sync PR [sync-upstream/pr/115961]
Version info
26.9.1.187(included in26.9and later)