Skip to content
About
Main content

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. Every mechanism here assumes an 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. , but city and postcode, currency and country, and timestamp and sequence number are strongly dependent. is almost absent from production formats, so this redundancy sits unused in every data warehouse.

The escapes and their prices

  • buy back random access at block . They cost ratio and an offset index.
  • buy back robustness to outliers. They cost a second access path and a branch.
  • buys back updatability. It costs write and a background cleaner. This time the cleaner is a scheduled job with a budget that somebody argues about every quarter.