Optimise AggregateFunctionSumMap functions family#107554
Conversation
There was a problem hiding this comment.
TODO: Decide if to keep it or drop it. Dropping it would change the serialized format - by entries being unsorted.
|
Workflow [PR], commit [4241774] Summary: ❌
AI ReviewSummaryThis PR replaces the I did not find unresolved correctness, compatibility, or safety issues in the current diff. I also rechecked the prior bot findings against the current code; they have been addressed, and the remaining stale bot thread was resolved. Missing context / blind spotsI did not run the new stateless or performance tests locally in this environment. Also, Final VerdictStatus: ✅ Approve |
|
📊 Cloud Performance Report ✅ AI verdict: This PR adds a typed fast-path for the sumMap/minMap/maxMap/sumMapFiltered aggregate family (plus a BFloat16 quiet_NaN helper); the private and public diffs are identical. None of the flagged queries — ClickBench Q22/Q23 and TPC-H Q4/Q7/Q20 — invoke those aggregate functions, so there is no plausible mechanism for this change to speed them up by 22-49%. The base-side measurements were noisy (CV up to ~88%) and several of these queries are flagged flaky or trending, consistent with run-to-run variance rather than a real PR effect. All five flagged improvements have been downgraded to not-sure. clickbenchFlagged queries (2 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_officialFlagged queries (3 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 ReportChanged lines: Changed C/C++ lines covered by tests: 755/844 (89.45%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 58 line(s) · Uncovered code |

Improves #92093
Also fixes: https://fiddle.clickhouse.com/38de3c8b-8da9-4af0-810f-223b3ec395fa
Changelog category (leave one):
Changelog entry:
Improved performance of
sumMap,sumMapWithOverflow,sumMapFiltered,minMap, andmaxMapby using typed aggregation paths for supported key and value types.