liveBook · Manning

Dictionary compression

As explained in 100 SQL Server Mistakes and How to Avoid Them

Dictionary compression stores repeated value representations once in a page dictionary and replaces row occurrences with pointers to those values.

Dictionary compression stores duplicate values once in a page dictionary and replaces row occurrences with pointers. It compares binary representations, so matching values can be identified across data types. section 10.9

Page compression applies row compression first, then prefix compression, and finally dictionary compression. A CI record near the page header anchors prefix data and stores the dictionary; its change count helps SQL Server decide whether rebuilding is worthwhile. section 10.9

Enable dictionary compression through page compression

ALTER TABLE ImpressionsArchive REBUILD WITH (DATA_COMPRESSION = PAGE);

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Descends to binary matching, dictionary placement, row pointers, and CI-record change tracking.
Examples
Uses ImpressionArchive, page-structure figures, and an ALTER TABLE rebuild command.
What you can do after
Operate/configure page compression with ALTER TABLE and estimate its potential storage savings.
How it connects
Connects dictionary compression to page compression, row compression, prefix compression, data pages, and binary representation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.