top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Data Compression in the context of SQL Server?

0 votes
270 views
What is Data Compression in the context of SQL Server?
posted Nov 25, 2014 by Roshan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

In SQL SERVER 2008 Data Compression comes in two flavors:
• Row Compression
• Page Compression

Row Compression
Row compression changes the format of physical storage of data. It minimize the metadata (column information, length, offsets etc) associated with each record. Numeric data types and fixed length strings are stored in variable-length storage format, just like Varchar.

Page Compression
Page compression allows common data to be shared between rows for a given page. Its uses the following techniques to compress data:
• Row compression.
• Prefix Compression. For every column in a page duplicate prefixes are identified. These prefixes are saved in compression information headers (CI) which resides after page header. A reference number is assigned to these prefixes and that reference number is replaced where ever those prefixes are being used.

Dictionary Compression.
Dictionary compression searches for duplicate values throughout the page and stores them in CI. The main difference between prefix and dictionary compression is that prefix is only restricted to one column while dictionary is applicable to the complete page.

answer Nov 25, 2014 by Manikandan J
Similar Questions
+3 votes

I have a table that looks something like this:

SetId ID Premium 
2012 5 Y 
2012 6 Y 
2013 5 N 
2013 6 N

I want to update the 2013 records with the premium values where the setid equals 2012.
So after the query it would look like this:

SetId ID Premium 
2012 5 Y
 2012 6 Y 
2013 5 Y 
2013 6 Y

Any help greatly appreciated

...