As the data grows, the database grows, and the disk space increases and the performance decreases. The data compression function of SQL Server 2008 can greatly reduce the data volume and improve query performance, especially for data warehouses. (Bestpractices for data warehousing with SQL Server 2008: http://msdn.microsoft.com/en-us/library/cc719165.aspx)
However, enabling data compression is a very CPU-consuming action. Can we make full use of the advantages of multiple CPUs? How to implement it?
For example, if page compression is enabled for a customer table, the following script is used:
Alter table customerrebuildwith (data_compression = page );
Since the database uses 8 CPUs, there are no other applications during maintenance, so we can use 8 CPUs for parallel compression:
Alter table customerrebuildwith (data_compression = page, maxdop = 8 );
The following figure shows the effect after maxdop is used.