You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] and [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]support row and page compression for rowstore tables and indexes, and supports columnstore and columnstore archival compression for columnstore tables and indexes.
32
+
[!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)], [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)], and [!INCLUDE [sssdsmifull-md](../../includes/sssdsmifull-md.md)]support row and page compression for rowstore tables and indexes, and support columnstore and columnstore archival compression for columnstore tables and indexes.
33
33
34
34
For rowstore tables and indexes, use the data compression feature to help reduce the size of the database. In addition to saving space, data compression can help improve performance of I/O intensive workloads because the data is stored in fewer pages and queries need to read fewer pages from disk. However, extra CPU resources are required on the database server to compress and decompress the data, while data is exchanged with the application. You can configure row and page compression on the following database objects:
35
35
- A whole table that is stored as a heap.
@@ -46,9 +46,9 @@ For columnstore tables and indexes, all columnstore tables and indexes always us
46
46
> [!NOTE]
47
47
> Data can also be compressed using the GZIP algorithm format. This is an additional step and is most suitable for compressing portions of the data when archiving old data for long-term storage. Data compressed using the `COMPRESS` function cannot be indexed. For more information, see [COMPRESS (Transact-SQL)](../../t-sql/functions/compress-transact-sql.md).
48
48
49
-
## Considerations row and page compression use
49
+
## Row and page compression
50
50
51
-
When you use row and page compression, be aware the following considerations:
51
+
When you use row and page compression, be aware the following considerations:
52
52
- The details of data compression are subject to change without notice in service packs or subsequent releases.
53
53
- Compression is available in [!INCLUDE[ssSDSfull_md](../../includes/sssdsfull-md.md)]
54
54
- Compression is not available in every edition of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. For more information, see [Features Supported by the Editions of SQL Server 2016](~/sql-server/editions-and-supported-features-for-sql-server-2016.md).
@@ -77,19 +77,15 @@ For columnstore tables and indexes, all columnstore tables and indexes always us
77
77
> [!NOTE]
78
78
> [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] supports the vardecimal storage format; however, because row-level compression achieves the same goals, the vardecimal storage format is deprecated. [!INCLUDE[ssNoteDepFutureAvoid](../../includes/ssnotedepfutureavoid-md.md)]
79
79
80
-
## Using Columnstore and Columnstore archive compression
## Columnstore and columnstore archive compression
85
81
86
82
Columnstore tables and indexes are always stored with columnstore compression. You can further reduce the size of columnstore data by configuring an additional compression called archival compression. To perform archival compression, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] runs the Microsoft XPRESS compression algorithm on the data. Add or remove archival compression by using the following data compression types:
87
83
- Use **COLUMNSTORE_ARCHIVE** data compression to compress columnstore data with archival compression.
88
84
- Use **COLUMNSTORE** data compression to decompress archival compression. The resulting data continue to be compressed with columnstore compression.
89
85
90
86
To add archival compression, use [ALTER TABLE (Transact-SQL)](../../t-sql/statements/alter-table-transact-sql.md) or [ALTER INDEX (Transact-SQL)](../../t-sql/statements/alter-index-transact-sql.md) with the REBUILD option and DATA COMPRESSION = COLUMNSTORE_ARCHIVE.
91
87
92
-
#### Examples:
88
+
For example:
93
89
94
90
```sql
95
91
ALTERTABLE ColumnstoreTable1
@@ -103,9 +99,9 @@ REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = COLUMNSTORE_ARCHIVE ON PARTITI
103
99
```
104
100
105
101
To remove archival compression and restore the data to columnstore compression, use [ALTER TABLE (Transact-SQL)](../../t-sql/statements/alter-table-transact-sql.md) or [ALTER INDEX (Transact-SQL)](../../t-sql/statements/alter-index-transact-sql.md) with the REBUILD option and DATA COMPRESSION = COLUMNSTORE.
106
-
107
-
#### Examples:
108
-
102
+
103
+
For example:
104
+
109
105
```sql
110
106
ALTERTABLE ColumnstoreTable1
111
107
REBUILD PARTITION =1 WITH (DATA_COMPRESSION = COLUMNSTORE) ;
@@ -141,7 +137,7 @@ The following system views contain information about data compression for cluste
141
137
142
138
The procedure [sp_estimate_data_compression_savings (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-estimate-data-compression-savings-transact-sql.md) can also apply to columnstore indexes.
143
139
144
-
## How compression affects partitioned tables and indexes
140
+
## Impact on partitioned tables and indexes
145
141
146
142
When you use data compression with partitioned tables and indexes, be aware of the following considerations:
147
143
- When partitions are split by using the `ALTER PARTITION` statement, both partitions inherit the data compression attribute of the original partition.
@@ -174,8 +170,6 @@ The procedure [sp_estimate_data_compression_savings (Transact-SQL)](../.
When you are using data compression with replication, be aware of the following considerations:
180
174
- When the Snapshot Agent generates the initial schema script, the new schema uses the same compression settings for both the table and its indexes. Compression cannot be enabled on just the table and not the index.
181
175
- For transactional replication the article schema option determines what dependent objects and properties have to be scripted. For more information, see [sp_addarticle](../../relational-databases/system-stored-procedures/sp-addarticle-transact-sql.md).
@@ -192,7 +186,7 @@ The following table shows replication settings that control compression during r
192
186
|To not replicate the partition scheme and not compress the data on the Subscriber.|False|False|Does not script partition or compression settings.|
193
187
|To compress the table on the Subscriber if all the partitions are compressed on the Publisher, but not replicate the partition scheme.|False|True|Checks if all the partitions are enabled for compression.<br /><br /> Scripts out compression at the table level.|
194
188
195
-
## How compression affects other SQL server components
0 commit comments