Apex › Storage & databases

Columnar storage — dictionary + RLE encoding

Why Parquet, Arrow, and ClickHouse store tables by column, not by row. A column store reads only the columns a query touches, and puts similar values next to each other so they compress with cheap, vectorizable schemes: dictionary encoding (distinct values → narrow integer codes) and run-length encoding (a run of equal codes → one (code, count) pair). Pick a column profile — sorted low-cardinality, shuffled, or unique IDs — and watch raw → dictionary → +RLE bytes and the ratio: sorted low-cardinality shrinks 100×+, shuffling loses RLE, and unique IDs defeat the dictionary entirely. The OLAP half of the row-vs-column split.

More in Storage & databases