Columnar Encoding
Columnar encoding stores relational data by column rather than by row, keeping values of the same type contiguous within each column, which enables type-specific compression and vectorized scans.
Purpose
It reduces I/O and improves compression for analytical (OLAP) queries, which need to read only a subset of columns.
Mechanism
Each column is stored independently and contiguously, combined with type-specific compression such as RLE, dictionary coding, bit-packing, and FOR. Rows are reassembled by mapping row numbers to per-column offsets.
Use cases
- OLAP columnar databases
- Data warehouse storage
- Log analysis engines