The Ultimate Compression Savings Estimation Script for an Entire Database

Data compression in SQL Server can definitely go a long way in saving storage space, as well as improve performance. It can especially be significant in very large databases. But in certain scenarios it can actually cause more harm than good, and it’s important to identify these scenarios.

I wrote this script which performs compression savings estimation checks for an ENTIRE database. Yeah there are plenty such scripts out there already, but there’s something in particular that they all seem to be missing, and that is the ability to actually generate the relevant remediation commands for you. After all, ain’t nobody got time for writing all those “ALTER TABLE/INDEX” commands themselves!

This is why I created the T-SQL script below. Check out the “messages” tab once the script completes execution, to find the resulting remediation commands. In addition, you will also get a query result with full details.

The script also performs various checks to determine whether PAGE or ROW compression type would be more beneficial (based on stuff such as range scans vs. updates percentage, difference in compression savings, etc.). It has several parameters at the top to control various thresholds and behaviors, so that you could fine tune it for your specific database.

Continue reading “The Ultimate Compression Savings Estimation Script for an Entire Database”

CI and CD with SSDT Part 2: Methodology & Features for DB DevOps (PASS Global Hebrew)

Watch now! In this session, the second of a 2-part series, we will cover the rich tools, features, and methodologies in SSDT that allow DBAs to implement a continuous database development lifecycle, and how to solve common problems and edge cases.

This webinar was delivered as part of the PASS Global Hebrew Virtual Chapter, and as such is presented in Hebrew. Continue reading CI and CD with SSDT Part 2: Methodology & Features for DB DevOps (PASS Global Hebrew)