What lightweight encoding forbids
Which properties can no lightweight encoding give you at once, and what does each escape cost?
Inside a block you cannot have maximum ratio, random access and in-place update at the same time. In practice you cannot have the third at all.
- Any encoding where decoding value i depends on other values loses random access.
- Any encoding whose size depends on the extremes of the block loses robustness to outliers.
- Every encoding here loses updatability, permanently. You cannot change one value inside an RLE run, a bit-packed block or a delta chain without rewriting the whole block. Every mechanism here assumes an append-only base. This is why row-store transaction databases (which update records in place) use almost none of these techniques, and why these encodings arrived historically together with immutable file formats.
- Encoding one column at a time cannot see redundancy between columns. Columns are encoded as if they were independent, but city and postcode, currency and country, and timestamp and sequence number are strongly dependent. Correlated-column detection is almost absent from production formats, so this redundancy sits unused in every data warehouse.
The escapes and their prices
- Restart points buy back random access at block granularity. They cost ratio and an offset index.
- Exception paths buy back robustness to outliers. They cost a second access path and a branch.
- Compaction buys back updatability. It costs write amplification and a background cleaner. This time the cleaner is a scheduled job with a budget that somebody argues about every quarter.