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
@@ -36,7 +36,7 @@ You can restore a database to any point in time within its backup retention peri
36
36
37
37
As such, restore isn't a size-of-data operation that remains the same. Restore of a Hyperscale database within the same Azure region finishes in minutes instead of hours or days, even for multi-terabyte databases.
38
38
39
-
Changing the [storage redundancy](hyperscale-automated-backups-overview.md#data-and-backup-storage-redundancy) when issuing a restore can result in longer restore times as the restore is the size of data, and hence the time is proportional to the database size.
39
+
Changing the [storage redundancy](hyperscale-automated-backups-overview.md#data-and-backup-storage-redundancy)or zone redundancy when issuing a restore can result in longer restore times as the restore is the size of data, and hence the time is proportional to the database size.
40
40
41
41
Creating new databases by restoring an existing backup or copying the database, also takes advantage of compute and storage separation in Hyperscale. You can create copies for development or testing purposes, even of multi-terabyte databases, in minutes within the same region when you use the same storage type.
Copy file name to clipboardExpand all lines: docs/relational-databases/indexes/columnstore-indexes-what-s-new.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ For feature availability in Azure SQL Managed Instance with a SQL Server [update
74
74
75
75
In [!INCLUDE [sql-server-2025](../../includes/sssql25-md.md)], when an ordered clustered columnstore index is built online, the sort algorithm uses `tempdb` instead of sorting the data in memory. If `MAXDOP` for the index build is 1, the build produces a fully ordered clustered columnstore index that doesn't have overlapping segments. This can improve performance of queries using the index. However, index build might take longer because of the additional I/O required for spills to `tempdb`. If a clustered columnstore index already exists, queries can continue using it while the fully ordered online index rebuild is in progress.
76
76
77
-
For more information, see [Reduce segment overlap](ordered-columnstore-indexes.md#reduce-segment-overlap).
77
+
For more information, see [Reduce segment overlap and improve query performance](ordered-columnstore-indexes.md#reduce-segment-overlap-and-improve-query-performance).
@@ -21,7 +21,7 @@ Ordered columnstore indexes can provide faster performance by skipping large amo
21
21
22
22
When a query reads a columnstore index, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] checks the minimum and maximum values stored in each column segment. The process eliminates segments that fall outside the bounds of the query predicate. In other words, it skips these segments when reading data from disk or memory. A query finishes faster if the number of segments to read and their total size is significantly smaller.
23
23
24
-
With certain data load patterns, data in a columnstore index might already be ordered. For example, if data loads occur every day, then the data might be ordered by a `load_date` column. In this case, query performance can already benefit from this implicit order. Ordering the columnstore index by the same `load_date` column explicitly isn't likely to provide an extra performance benefit.
24
+
With certain data load patterns, data in a columnstore index might be ordered implicitly without specifying the `ORDER` clause. For example, if data loads occur every day, then the data might be ordered by a `load_date` column. In this case, query performance can already benefit from this implicit order. Ordering the columnstore index by the same `load_date` column explicitly in the `ORDER` clause isn't likely to provide an extra performance benefit.
25
25
26
26
For ordered columnstore index availability in various SQL platforms and SQL Server versions, see [Ordered columnstore index availability](columnstore-indexes-overview.md#ordered-columnstore-index-availability).
27
27
@@ -33,57 +33,53 @@ In a columnstore index, the data in each column of each rowgroup is compressed i
33
33
34
34
When a columnstore index isn't ordered, the index builder doesn't sort the data before compressing it into segments. That means that segments with overlapping value ranges can occur, causing queries to read more segments to obtain the required data. As a result, queries can take longer to finish.
35
35
36
-
When you create an ordered columnstore index, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] sorts the existing data by the order keys you specify before the index builder compresses them into segments. With sorted data, segment overlapping is reduced or eliminated, allowing queries to use a more efficient segment elimination and thus faster performance because there are fewer segments and less data to read.
36
+
When you create an ordered columnstore index by specifying the `ORDER` clause in the [CREATE COLUMNSTORE INDEX](../../t-sql/statements/create-columnstore-index-transact-sql.md) statement, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] sorts the data in each segment of each order column before the index builder compresses the data into segments. With sorted data, segment overlapping is reduced or eliminated, allowing queries to use a more efficient segment elimination and thus faster performance because there are fewer segments and less data to read.
37
37
38
-
## Reduce segmentoverlap
38
+
<aid="reduce-segment-overlap"></a>
39
39
40
-
When you build an ordered columnstore index, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] sorts the data on a best-effort basis. Depending on the available memory, the data size, the degree of parallelism, the index type (clustered vs. nonclustered), and the type of index build (offline vs. online), the sort for ordered columnstore indexes might be full with no segment overlap, or partial with some segment overlap.
40
+
## Reduce segment overlap and improve query performance
41
41
42
-
The following table describes the resulting sort type when you create or rebuild an ordered columnstore index, depending on the index build options.
42
+
When you build an ordered columnstore index, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] sorts the data on a best-effort basis. Depending on the available memory, the data size, the degree of parallelism, the index type (clustered vs. nonclustered), and the type of index build (offline vs. online), the order a column in a columnstore index might be full with no segment overlap, or partial with some segment overlap. When there are fewer overlapping segments, a query that can take advantage of column order runs faster.
43
43
44
-
| Prerequisites | Sort type |
44
+
> [!TIP]
45
+
> Even if the order in a column of a columnstore index is partial, segments can still be eliminated (skipped). A full order isn't required to gain performance benefits if a partial order avoids many segment overlaps.
46
+
47
+
The following table describes the resulting order type when you create or rebuild an ordered columnstore index, depending on the index build options.
48
+
49
+
| Prerequisites | Order type |
45
50
| --- | --- |
46
51
|`ONLINE = ON` and `MAXDOP = 1`| Full |
47
52
|`ONLINE = OFF`, `MAXDOP = 1`, and the data to sort fully fits in the query workspace memory | Full |
48
53
| All other cases | Partial |
49
54
50
-
In the first case when both `ONLINE = ON` and `MAXDOP = 1`, the sort isn't limited by the query workspace memory because an online build of an ordered columnstore index uses the `tempdb` database to spill the data that doesn't fit in memory. This approach can make the index build process slower due to the additional `tempdb` I/O. However, because the index build is performed online, queries can continue using the existing index while the new ordered index is being built.
55
+
In the first case when both `ONLINE = ON` and `MAXDOP = 1`, the sort isn't limited by the query workspace memory because an online build of an ordered columnstore index uses the `tempdb` database to spill the data that doesn't fit in memory. This approach can make the index build process slower due to the additional `tempdb` I/O, and requires sufficient free space in `tempdb`. However, because the index build is performed online, queries can continue using the existing index while the new ordered index is being built.
51
56
52
57
Similarly, with an offline rebuild of a partitioned columnstore index, the rebuild is done one partition at a time. Other partitions remain available for queries.
53
58
54
59
When `MAXDOP` is greater than 1, each thread used for ordered columnstore index build works on a subset of data and sorts it locally. There's no global sorting across data sorted by different threads. Using parallel threads can reduce the time to create the index, but it results in more overlapping segments than when using a single thread.
55
60
56
-
> [!TIP]
57
-
> Even if the sort in an ordered columnstore index is partial, segments can still be eliminated (skipped). A full sort isn't required to gain query performance benefits if a partial sort avoids many segment overlaps.
58
-
>
59
-
> To find the number of overlapping and non-overlapping segments in an ordered columnstore index, see the [Determine the sort quality for an ordered columnstore index](#determine-the-sort-quality-for-an-ordered-columnstore-index) example.
60
-
61
61
You can create or rebuild ordered columnstore indexes online only in some SQL platforms and SQL Server versions. For more information, see [Feature summary for product releases](columnstore-indexes-what-s-new.md#feature-summary-for-product-releases).
62
62
63
63
In SQL Server, online index operations aren't available in all editions. For more information, see [Editions and supported features of SQL Server 2025](../../sql-server/editions-and-components-of-sql-server-2025.md) and [Perform index operations online](perform-index-operations-online.md).
64
64
65
-
### Add new data or update existing data
66
-
67
-
The new data resulting from a DML batch or a bulk load operation on an ordered columnstore index is sorted within that batch only. There's no global sorting that includes existing data in the table. To reduce segment overlaps after inserting new data or updating existing data, rebuild the index.
68
-
69
65
## Query performance
70
66
71
-
The performance gain from an ordered columnstore index depends on the query patterns, the size of data, the sort quality, and the compute resources available for query execution.
67
+
The performance gain from an ordered columnstore index depends on the query patterns, the size of data, the number of overlapping segments, and the compute resources available for query execution.
72
68
73
69
Queries with the following patterns typically run faster with ordered columnstore indexes:
74
70
75
71
- Queries that have equality, inequality, or range predicates.
76
72
- Queries where the predicate columns and the ordered CCI columns are the same.
77
73
78
-
In this example, table `T1` has a clustered columnstore index ordered in the sequence of `Col_C`, `Col_B`, and `Col_A`.
74
+
In the following example, table `T1` has a clustered columnstore index with `Col_C`, `Col_B`, and `Col_A` as ordered columns.
79
75
80
76
```sql
81
-
CREATE CLUSTERED COLUMNSTORE INDEX MyOrderedCCI
77
+
CREATE CLUSTERED COLUMNSTORE INDEX OrderedCCI
82
78
ON T1
83
-
ORDER(Col_C, Col_B, Col_A);
79
+
ORDER(Col_C, Col_B, Col_A);
84
80
```
85
81
86
-
The performance of query 1 and 2 can benefit from ordered columnstore index more than query 3 and 4, because they reference all the ordered columns.
82
+
Query 1 benefits from the ordered columnstore index more than queries 2 and 3, because query 1 references all the ordered columns in its predicate.
87
83
88
84
```sql
89
85
-- query 1
@@ -97,18 +93,11 @@ WHERE Col_C = 'c'
97
93
SELECT*
98
94
FROM T1
99
95
WHERE Col_B ='b'
100
-
AND Col_C ='c'
101
96
AND Col_A ='a';
102
97
103
98
-- query 3
104
99
SELECT*
105
100
FROM T1
106
-
WHERE Col_B ='b'
107
-
AND Col_A ='a';
108
-
109
-
-- query 4
110
-
SELECT*
111
-
FROM T1
112
101
WHERE Col_A ='a'
113
102
AND Col_C ='c';
114
103
```
@@ -117,6 +106,12 @@ WHERE Col_A = 'a'
117
106
118
107
The performance of a data load into a table with an ordered columnstore index is similar to a partitioned table. Loading data can take longer than with a non-ordered columnstore index because of the data sorting operation, but queries can run faster afterwards.
119
108
109
+
### Add new data or update existing data
110
+
111
+
The new data resulting from a DML batch or a bulk load operation on a table with an ordered columnstore index is sorted within that batch only. There's no global sorting that includes existing data in the table because compressed rowgroups in a columnstore index are immutable.
112
+
113
+
To reduce segment overlap after inserting new data or updating existing data, rebuild the columnstore index.
114
+
120
115
## Examples
121
116
122
117
### Create an ordered columnstore index
@@ -171,7 +166,9 @@ ORDER(Column1, Column2)
171
166
WITH (DROP_EXISTING =ON);
172
167
```
173
168
174
-
### Create an ordered clustered columnstore index online with full sort on a heap table
### Rebuild an ordered clustered columnstore index online with full order
184
183
185
184
```sql
186
185
CREATE CLUSTERED COLUMNSTORE INDEX OCCI
@@ -189,56 +188,6 @@ ORDER(Column1)
189
188
WITH (DROP_EXISTING =ON, ONLINE =ON, MAXDOP =1);
190
189
```
191
190
192
-
### Determine the sort quality for an ordered columnstore index
193
-
194
-
This example determines the sort quality for all ordered columnstore indexes in the database. In this example, sort quality is defined as a ratio of non-overlapping segments to all segments for each order column, expressed as a percentage.
195
-
196
-
```sql
197
-
WITH ordered_column_segment
198
-
AS (SELECTp.object_id,
199
-
i.nameAS index_name,
200
-
ic.column_store_order_ordinal,
201
-
cls.row_count,
202
-
cls.column_id,
203
-
cls.min_data_id,
204
-
cls.max_data_id,
205
-
LAG(max_data_id) OVER (
206
-
PARTITION BY cls.partition_id, ic.column_store_order_ordinal
207
-
ORDER BYcls.min_data_id
208
-
) AS prev_max_data_id,
209
-
LEAD(min_data_id) OVER (
210
-
PARTITION BY cls.partition_id, ic.column_store_order_ordinal
211
-
ORDER BYcls.min_data_id
212
-
) AS next_min_data_id
213
-
FROMsys.partitionsAS p
214
-
INNER JOINsys.indexesAS i
215
-
ONp.object_id=i.object_id
216
-
ANDp.index_id=i.index_id
217
-
INNER JOINsys.column_store_segmentsAS cls
218
-
ONp.partition_id=cls.partition_id
219
-
INNER JOINsys.index_columnsAS ic
220
-
ONic.object_id=p.object_id
221
-
ANDic.index_id=p.index_id
222
-
ANDic.column_id=cls.column_id
223
-
WHEREic.column_store_order_ordinal>0)
224
-
SELECT OBJECT_SCHEMA_NAME(object_id) AS schema_name,
225
-
OBJECT_NAME(object_id) AS object_name,
226
-
index_name,
227
-
INDEXPROPERTY(object_id, index_name, 'IsClustered') AS is_clustered_column_store,
228
-
COL_NAME(object_id, column_id) AS order_column_name,
229
-
column_store_order_ordinal,
230
-
SUM(row_count) AS row_count,
231
-
SUM(is_overlapping_segment) AS overlapping_segments,
[Microsoft Report Builder](https://www.microsoft.com/download/details.aspx?id=53613) uses Managed ODP.NET for authoring paginated (RDL) reports. You only need the following steps for Oracle ODAC drivers 12.2 and later. Otherwise, they install by default to a non-machine-wide configuration for a new Oracle home installation.
> The following instructions apply to Power BI Report Builder version 15.7.01678.0001 and later. For versions before 15.7.01678.0001, follow the **32-bit drivers for Microsoft Report Builder** instructions.
89
+
> The following instructions apply to Power BI Report Builder version 15.7.01678.0001 and later as well as Microsoft Report Builder version 15.1.20318.47 and later. For previous versions, follow the **32-bit drivers for Report Builder** instructions.
90
90
91
91
[Power BI Report Builder](https://www.microsoft.com/download/details.aspx?id=105942) uses Managed ODP.NET for authoring paginated (RDL) reports. You only need the following steps for Oracle ODAC drivers 12.2 and later. Otherwise, they install by default to a non-machine-wide configuration for a new Oracle home installation.
0 commit comments