Data column encoding size estimate calculator

Compares fixed-width raw storage with an ideal bit-packed dictionary index plus one raw dictionary entry per distinct value.

Your inputs

Use the units shown.

Raw column size (bytes)
8,000
Dictionary index width (bits/row)
4
Dictionary encoded size (bytes)
628
Bytes saved (bytes)
7,372

Your calculation
How is this calculated?

Multiply rows by raw value width.

Use enough bits to address every distinct dictionary entry.

Add raw dictionary bytes and packed indices rounded to whole bytes.

Subtract encoded size from raw size.

Compares fixed-width raw storage with an ideal bit-packed dictionary index plus one raw dictionary entry per distinct value. Headers, null bitmaps and codec overhead are excluded.

Apache Parquet Encodings — Dictionary Encoding ↗

Try an example

Worked example

Raw column size (bytes): 8,000

Inputs
  • Column rows (count): 1000
  • Distinct values (count): 16
  • Raw value width (bytes): 8

Compare inputs

Raw column size (bytes): 8,000

Inputs
  • Column rows (count): 1000
  • Distinct values (count): 2
  • Raw value width (bytes): 8
Share this page
Share this calculator

Leave unchecked to share the page without your entered values.