ClickHouse Sorts in Parallel: Partial Sort, Merge Sorted Streams and External Sort
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…