Skip to content
About
Main content
Model

Dictionary encoding: when it pays

When the dictionary grows, it becomes the main cost.

Values
values in the column
Distinct values
distinct values
Value size
average value size (bytes)

How it behaves

One input on the horizontal axis, the others held fixed.

Data table
Compression ratio by distinct values (10⁶ strings of 20 bytes)
Distinct values kCompression ratio
2160×
2.3680×
2.7880×
3.2780×
3.8580×
4.5453.3×
5.3553.3×
6.3153.3×
7.4353.3×
8.7540×
10.340×
12.240×
14.340×
16.932×
19.932×
23.432×
27.632×
32.526.6×
38.326.6×
45.126.6×
53.226.6×
62.726.6×
73.822.8×
8722.8×
10222.8×
12122.8×
14219.9×
16819.9×
19819.9×
23319.9×
27417.7×
32317.7×
38117.7×
44917.6×
52915.9×
62315.8×
73415.8×
86515.8×
1.02K15.7×
1.2K14.3×
1.41K14.3×
1.67K14.2×
1.96K14.1×
2.31K12.9×
2.73K12.9×
3.21K12.8×
3.78K12.7×
4.46K11.7×
5.25K11.6×
6.19K11.4×
7.29K11.3×
8.59K10.4×
10.1K10.2×
11.9K10.1×
14.1K9.85×
16.6K9.07×
19.5K8.83×
23K8.57×
27.1K8.28×
31.9K7.96×
37.6K7.27×
44.3K6.93×
52.2K6.57×
61.5K6.19×
72.5K5.6×
85.4K5.22×
101K4.83×
119K4.45×
140K3.97×
165K3.61×
194K3.26×
228K2.93×
269K2.58×
317K2.29×
374K2.03×
440K1.79×
519K1.57×
611K1.36×
720K1.18×
849K1.03×
1M0.889×

Worked examples, recomputed

Every number the mechanisms quote for this relationship is recomputed from it, so none of them disagrees with it.

Where it appears

Each mechanism states it in its own names. The general symbol each name stands for is shown with it.