You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The allocation-capacity preflight for saved DISTINCT aggregate arguments detects duplicates within each hashmap work unit by scanning every earlier row. With B rows per work unit, this is O(B²), even when all values are unique.
This affects exact DISTINCT aggregate implementations that retain arguments for merge/spill. It is independent of any specific SQL shape, although high-cardinality mixed aggregation makes it visible.
Evidence
A focused benchmark ingesting 65,536 unique INT64 values into one COUNT(DISTINCT) group takes about 200–203 ms on the current implementation. CPU profiling attributes time to the preflight back-scan in addition to the resident skiplist probes.
Expected behavior
Deduplicate candidates within the bounded 256-row work unit in expected O(B) time, with:
exact collision verification;
no row-frequency allocation;
unchanged NULL, const-vector, logical-offset, multi-column, and floating signed-zero semantics;
unchanged allocation admission and publication atomicity.
Activity
perf: linearize DISTINCT aggregate preflight deduplication (#27688)
perf: linearize DISTINCT aggregate preflight deduplication (matrixori…
perf: linearize DISTINCT aggregate preflight deduplication (matrixori…
perf: linearize DISTINCT aggregate preflight deduplication (matrixori…