Data compression can dramatically decrease the amount of storage a file takes up. For example, in a 2:1 compression ratio, a 20 megabyte (MB) file takes up 10 MB of space. As a result of compression, administrators spend less money and less time on storage.
The main advantages of compression are reductions in storage hardware, data transmission time, and communication bandwidth. This can result in significant cost savings. Compressed files require significantly less storage capacity than uncompressed files, meaning a significant decrease in expenses for storage.
Thus, a representation that compresses the storage size of a file from 10MB to 2MB yields a space saving of 1 - 2/10 = 0.8, often notated as a percentage, 80%.DefinitionLossless vs. Lossy
Overview
Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance
Returns the current size of the requested object and estimates Arguments
[ @schema_name = ] 'schema_name'
The name of the database schema that contains the table or indexed view Return code values
0 (success) or 1 (failure) Result set
The following result set is returned to provide current and estimated size for the table, index, or partition Remarks
Use sp_estimate_data_compression…
If the results of running sp_estimate_data_compression…
If a table is already enabled for Permissions
Requires SELECT permission on the table, VIEW DATABASE STATE and VIEW DEFINITION on the database containing the table and on tempdb Limitations
Prior to SQL Server 2019 (15.x), this procedure didn't apply to columnstore indexes Considerations for columnstore indexes
Starting with SQL Server 2019 (15.x), and in Azure SQL Database and Azure SQL Managed Instance Examples
A. Estimate savings with ROW compression
The following example estimates the size of the Production Next steps
1. CREATE TABLE (Transact-SQL)
2. CREATE INDEX (Transact-SQL)
3