Database Animations: The Difference Between Row Compression and Page Compression


What’s the difference between SQL Server’s row compression and page compression, and when does each one make sense?

Row compression turns every fixed-length datatype into a variable-length datatype, using as little space as possible to store it Page compression does that, AND adds a dictionary of repeated data on the page, getting more compression at the cost of more CPU

To see it in more detail, let’s fire up one of my Database Animations.

How Row Compression Works

Let’s start by looking at the clustered index of the Users table from the Stack Overflow database you know and