Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Compression VARCHAR - not seeing results

Author  Topic 

Mr. Flibble
Starting Member

7 Posts

Posted - 2012-03-20 : 05:22:26
Hello.

I have been experimenting with compression in SQL Server but so far I have not seen the results that I expected.


To test I have created a new table with single VARCHAR(8000) column and inserted 100k rows into it. Each row contains about 500 words of text, which using ZIP compression sees over a 90% saving in space.

I am using the command EXEC sp_estimate_data_compression_savings 'dbo', 'MyTable', NULL, NULL, 'PAGE' ; to check how much space would be saved using PAGE compression, but it is telling me that there won't be much at all. The results are as follows:

object_name schema_name index_id partition_number size_with_current_compression_setting(KB) size_with_requested_compression_setting(KB) sample_size_with_current_compression_setting(KB) sample_size_with_requested_compression_setting(KB)
MyTable dbo 0 1 94048 93440 40064 39808


Which is basically no saving at all. Where am I going wrong?

ps. I have tried the same experiment with NVARCHAR(4000) column, and compression does show savings there, but I believe this is because the compression forcing use of 1 char instead of two where the data doesn't require 2 chars. It doesn't actually compress the data in a way similar to ZIP would.

   

- Advertisement -