cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

column compression

MCMartin
Participant
3,620

The documentation recommends not to compress columns with less than 130 chars. Anyway the sa_column_stats procedure has a value num_values_compressed. So there seems to be a mechanism which prevents to compress rows which have a value of less than 130 chars and still compress rows with values where compression would be beneficial.

Is this correct?

View Entire Topic
graeme_perrow
Advisor
Advisor

Breck's statement that the INLINE and PREFIX values are not related to column compression is incorrect. Values shorter than the INLINE value of the column (default 256) are not compressed, and the statement that "The prefix data for a compressed column is stored uncompressed, so if all the data required to satisfy a request is stored in the prefix, no decompression is necessary" is correct.

The bit in the docs that says "Do not use column compression on columns containing values under 130 bytes" is more of a guideline, since attempting to compress values that small will likely result in a larger value being stored because of the compression overhead. It only applies if you've set your INLINE value to something less than 130 anyway.

MCMartin
Participant

Great to know, so normally leaving everything default will mean that only the data in the extended pages will be compressed for varchar columns. Maybe this should be stated more explicit in the documentation.