A LowCardinality column stores one byte per row instead of a whole string, because every block in a part points at the same dictionary — capped at 8192 keys and flushed when it …
A MergeTree scan isn’t a full scan. Parts are cut into granules, each granule gets a bit-packed mark, and the primary key index stores one key value per granule — so…
ClickHouse picks one of thirteen hash-table shapes for IN based on the key type, then spills the set to disk behind per-block Bloom filters when it outgrows RAM.
ClickHouse never sorts the whole dataset at once. It sorts each chunk, throws away rows that can’t make the top-N, merges the sorted streams, and spills runs to disk when…
ClickHouse picks merge candidates with a tiny, explicit cost model: score each contiguous range as sum_size / (count - 1.9), pick the cheapest admissible one, and only ever…