When using row-level or page-level compression with SQL Server 2008 R2, does SQL Server store the data into its buffer cache in its compressed form or its expanded form.
For example, let’s say I have a table that is (page-level) compressed down to 20% of its original size:
Original size: 100 GB
Compressed size: 20 GB
Furthermore, the (dedicated) host that this particular instance of SQL Server is running on has 24 GB of memory. If a query performs a table scan, looking at all columns (for the sake of example) and SQL Server caches the data as compressed, theoretically it can have all of the data in its buffer cache and available for future queries. If the data is cached uncompressed, however, clearly 100 GB of data cannot fit into 24 GB of server memory.
So, how does SQL Server store compressed data in its buffer cache?
Compressed pages are persisted as compressed on disk and stay compressed when read into memory.
Ref: SQL Server 2008 Data Compression: Strategy, Capacity Planning and Best Practices: