This article is half-done without your Comment! *** Please share your thoughts via Comment ***
To complete this article, you must visit my yesterday’s post where I explained about the use of sp_estimate_data_compression_savings system stored procedure of SQL Server.
In this post, I continue my demonstration and am using the same example of a table from the previous post. SQL Server 2016 introduced the Data Compression algorithm for compressing or reducing the size of an object.
For more detail – visit this official LINK.
In this previous post, We can see 40% space that we can reduce of a tbl_Dumpdata table.
How?
I created a clustered index on that table, so for data compression, we have to REBUILD that index with option DATA_COMPRESSION.
Rebuild Index with DATA_COMPRESSION:
1 2 3 4 5 |
ALTER INDEX pk_tbl_DumpData_ID ON dbo.tbl_DumpData REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE) GO |
Now, check the space for PAGE option:
Check the below result, you can find the same value of column size_with_current_compression_setting and size_with_requested_compression_setting.
1 2 3 4 5 6 |
EXEC sp_estimate_data_compression_savings @schema_name = 'dbo', @object_name = 'tbl_DumpData', @index_id = NULL, @partition_number = NULL, @data_compression = 'PAGE' |
Leave a Reply