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
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
@@ -26,7 +26,7 @@ This table summarizes key features for columnstore indexes and the products in w
26
26
27
27
For feature availability in Azure SQL Managed Instance with a SQL Server [update policy](/azure/azure-sql/managed-instance/update-policy), refer to the column for the corresponding version of SQL Server.
28
28
29
-
| Columnstore Index Feature |[!INCLUDE [sssql16-md](../../includes/sssql16-md.md)]<sup>1</sup> |[!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]|[!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]|[!INCLUDE [sql-server-2022](../../includes/sssql22-md.md)]|[!INCLUDE [sql-server-2025](../../includes/sssql25-md.md)]|[!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]<sup>2</sup> and [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)]|[!INCLUDE [ssazuresynapse-md](../../includes/ssazuresynapse-md.md)] and [!INCLUDE [Warehouse](../../includes/fabric-dw.md)]|
29
+
| Columnstore Index Feature |[!INCLUDE [sssql16-md](../../includes/sssql16-md.md)]<sup>1</sup> |[!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]|[!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]|[!INCLUDE [sql-server-2022](../../includes/sssql22-md.md)]|[!INCLUDE [sql-server-2025](../../includes/sssql25-md.md)]|[!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]<sup>2</sup> and [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)]|[!INCLUDE [ssazuresynapse-md](../../includes/ssazuresynapse-md.md)] and [!INCLUDE [Warehouse](../../includes/fabric-dw.md)]|
Copy file name to clipboardExpand all lines: docs/relational-databases/statistics/statistics.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: The Query Optimizer uses statistics to create query plans that impr
4
4
author: WilliamDAssafMSFT
5
5
ms.author: wiassaf
6
6
ms.reviewer: derekw, randolphwest
7
-
ms.date: 07/07/2025
7
+
ms.date: 01/27/2025
8
8
ms.service: sql
9
9
ms.subservice: performance
10
10
ms.topic: concept-article
@@ -348,14 +348,18 @@ If statistics are missing, perform the following steps:
348
348
- Verify that the database isn't read-only. If the database is read-only, a new statistics object can't be saved.
349
349
- Create the missing statistics by using the [CREATE STATISTICS](../../t-sql/statements/create-statistics-transact-sql.md) statement.
350
350
351
-
When statistics on a read-only database or read-only snapshot are missing or stale, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] creates and maintains temporary statistics in `tempdb`. When the [!INCLUDE [ssDE](../../includes/ssde-md.md)] creates temporary statistics, the statistics name is appended with the suffix *_readonly_database_statistic* to differentiate the temporary statistics from the permanent statistics. The suffix *_readonly_database_statistic* is reserved for statistics generated by SQL Server. Scripts for the temporary statistics can be created and reproduced on a read-write database. When scripted, [!INCLUDE [ssManStudio](../../includes/ssmanstudio-md.md)] changes the suffix of the statistics name from *_readonly_database_statistic* to *_readonly_database_statistic_scripted*.
351
+
#### Temporary statistics
352
352
353
-
Only SQL Server can create and update temporary statistics. However, you can delete temporary statistics and monitor statistics properties using the same tools that you use for permanent statistics:
353
+
When statistics on a read-only database or read-only snapshot are missing or stale, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] creates and maintains temporary statistics in `tempdb`. When the [!INCLUDE [ssDE](../../includes/ssde-md.md)] creates temporary statistics, the statistics name is appended with the suffix *_readonly_database_statistic* to differentiate the temporary statistics from the permanent statistics. The suffix *_readonly_database_statistic* is reserved for statistics generated by the [!INCLUDE [ssDE](../../includes/ssde-md.md)]. Scripts for the temporary statistics can be created and executed on a read-write database. When scripted, [!INCLUDE [ssManStudio](../../includes/ssmanstudio-md.md)] changes the suffix of the statistics name from *_readonly_database_statistic* to *_readonly_database_statistic_scripted*.
354
+
355
+
Only the [!INCLUDE [ssDE](../../includes/ssde-md.md)] can create and update temporary statistics. However, you can delete temporary statistics and monitor statistics properties using the same tools that you use for permanent statistics:
354
356
355
357
- Delete temporary statistics using the [DROP STATISTICS](../../t-sql/statements/drop-statistics-transact-sql.md) statement.
356
-
- Monitor statistics using the **[sys.stats](../system-catalog-views/sys-stats-transact-sql.md)** and **[sys.stats_columns](../system-catalog-views/sys-stats-columns-transact-sql.md)** catalog views. The `sys.stats` system catalog view includes the `is_temporary` column, to indicate which statistics are permanent and which are temporary.
358
+
- Monitor statistics using the [sys.stats](../system-catalog-views/sys-stats-transact-sql.md) and [sys.stats_columns](../system-catalog-views/sys-stats-columns-transact-sql.md) catalog views. The `sys.stats` system catalog view includes the `is_temporary` column, to indicate which statistics are permanent and which are temporary.
359
+
360
+
Because temporary statistics are stored in `tempdb`, a restart of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] removes all temporary statistics.
357
361
358
-
Because temporary statistics are stored in `tempdb`, a restart of the SQL Server service causes all temporary statistics to disappear.
362
+
Just like for all statistics, creating and updating temporary statistics requires a schema modification (`Sch-M`) lock on the object. This lock might block other queries and processes, including the system redo process on secondary replicas that applies transactions from the primary replica. If this blocking affects query workloads or data propagation, you can disable the automatic creation and update of temporary statistics using the `READABLE_SECONDARY_TEMPORARY_STATS_AUTO_CREATE` and `READABLE_SECONDARY_TEMPORARY_STATS_AUTO_UPDATE`[database-scoped configurations](../../t-sql/statements/alter-database-scoped-configuration-transact-sql.md) respectively.
|**partition_ordinal**|**tinyint**|Ordinal (1-based) within set of partitioning columns. A clustered columnstore index can have at most one partitioning column.<br /><br />0 = Not a partitioning column.|
37
37
|**is_descending_key**|**bit**|`1` = Index key column has a descending sort direction.<br /><br />`0` = Index key column has an ascending sort direction, or the column is part of a columnstore or hash index.|
38
38
|**is_included_column**|**bit**|`1` = Column is a nonkey column added to the index by using the CREATE INDEX INCLUDE clause, or the column is part of a columnstore index.<br /><br />`0` = Column isn't an included column.<br /><br />Columns implicitly added because they're part of the clustering key aren't listed in `sys.index_columns`.<br /><br />Columns implicitly added because they're a partitioning column are returned as `0`.|
39
-
|**column_store_order_ordinal**|**tinyint**|**Applies to**: [!INCLUDE[ssazuresynapse-md](../../includes/ssazuresynapse-md.md)], [!INCLUDE[sssql22-md](../../includes/sssql22-md.md)], [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], and [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)]<br /><br />Ordinal (1-based) within set of order columns in an ordered columnstore index. For more on ordered columnstore indexes, see [Performance tuning with ordered columnstore indexes](../indexes/ordered-columnstore-indexes.md).|
39
+
|**column_store_order_ordinal**|**tinyint**|**Applies to**: [!INCLUDE[ssazuresynapse-md](../../includes/ssazuresynapse-md.md)], [!INCLUDE[sssql22-md](../../includes/sssql22-md.md)], [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], and [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)]<br /><br />Ordinal (1-based) within set of order columns in an ordered columnstore index. For more on ordered columnstore indexes, see [Performance tuning with ordered columnstore indexes](../indexes/ordered-columnstore-indexes.md).|
40
40
|`data_clustering_ordinal`|**tinyint**| 0 = Not a columnstore index & data clustering ordinal doesn't apply <br /> **Applies to**: [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)]|
Copy file name to clipboardExpand all lines: docs/t-sql/functions/product-aggregate-transact-sql.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
@@ -87,7 +87,7 @@ Returns the product of all *expression* values in the most precise *expression*
87
87
88
88
## Remarks
89
89
90
-
Support for `PRODUCT` in [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)] is limited to [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)].
90
+
Support for `PRODUCT` in [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)] is limited to [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)].
91
91
92
92
`PRODUCT` is a deterministic function when used without the `OVER` and `ORDER BY` clauses. It's nondeterministic when specified with the `OVER` and `ORDER BY` clauses. For more information, see [Deterministic and nondeterministic functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
| QUERY_OPTIMIZER_HOTFIXES = { ON | OFF | PRIMARY }
115
+
| READABLE_SECONDARY_TEMPORARY_STATS_AUTO_CREATE = { ON | OFF | PRIMARY }
116
+
| READABLE_SECONDARY_TEMPORARY_STATS_AUTO_UPDATE = { ON | OFF | PRIMARY }
115
117
| ROW_MODE_MEMORY_GRANT_FEEDBACK = { ON | OFF }
116
118
| TSQL_SCALAR_UDF_INLINING = { ON | OFF }
117
119
| VERBOSE_TRUNCATION_WARNINGS = { ON | OFF }
@@ -513,6 +515,22 @@ This value is valid only on secondaries while the database is on the primary. It
513
515
514
516
For more information on `QUERY_OPTIMIZER_HOTFIXES`, see [SQL Server query optimizer hotfix trace flag 4199 servicing model](https://support.microsoft.com/help/974006).
515
517
518
+
#### READABLE_SECONDARY_TEMPORARY_STATS_AUTO_CREATE = { ON | OFF | PRIMARY }
519
+
520
+
**Applies to**: [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)] and later versions, [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)], and [!INCLUDE [ssazure-sqlmi-2025](../../includes/applies-to-version/ssazure-sqlmi-2025.md)]
521
+
522
+
Enables or disables the automatic creation of [temporary statistics](../../relational-databases/statistics/statistics.md#temporary-statistics) for readable secondary replicas of a database and for database snapshots.
523
+
524
+
The default is `ON`.
525
+
526
+
#### READABLE_SECONDARY_TEMPORARY_STATS_AUTO_UPDATE = { ON | OFF | PRIMARY }
527
+
528
+
**Applies to**: [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)] and later versions, [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)], and [!INCLUDE [ssazure-sqlmi-2025](../../includes/applies-to-version/ssazure-sqlmi-2025.md)]
529
+
530
+
Enables or disables the automatic update of [temporary statistics](../../relational-databases/statistics/statistics.md#temporary-statistics) for readable secondary replicas of a database and for database snapshots.
531
+
532
+
The default is `ON`.
533
+
516
534
#### ROW_MODE_MEMORY_GRANT_FEEDBACK = { ON | OFF }
517
535
518
536
**Applies to**: [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)] and later versions, [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], and [!INCLUDE [ssazuremi](../../includes/ssazuremi-md.md)]
Copy file name to clipboardExpand all lines: docs/t-sql/statements/create-columnstore-index-transact-sql.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Follow [What's new in columnstore indexes](../../relational-databases/indexes/co
49
49
50
50
## Syntax
51
51
52
-
Syntax for [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)] and [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)]:
52
+
Syntax for [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)] and [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)]:
53
53
54
54
```syntaxsql
55
55
-- Create a clustered columnstore index on disk-based table.
@@ -149,7 +149,7 @@ Some of the options aren't available in all database engine versions. The follow
All options are available in Azure SQL Database and [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)].
152
+
All options are available in Azure SQL Database and [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)].
153
153
154
154
For more detail on feature availability, see [What's new in columnstore indexes](../../relational-databases/indexes/columnstore-indexes-what-s-new.md#feature-summary-for-product-releases).
155
155
@@ -503,7 +503,7 @@ Columns that use any of the following data types can't be included in a columnst
503
503
- Can't be changed by using the `ALTER INDEX` statement. To change the nonclustered index, you must drop and re-create the columnstore index instead. You can use `ALTER INDEX` to disable and rebuild a columnstore index.
504
504
- Can't be created by using the `INCLUDE` keyword.
505
505
- Can't specify the `ASC` or `DESC` keywords in the list of index columns. Columnstore indexes are ordered according to the compression algorithms.
506
-
- In [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], [!INCLUDE [fabric-sqldb](../../includes/fabric-sqldb.md)], [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)], and [!INCLUDE [sql-server-2025](../../includes/sssql25-md.md)] can be ordered by including the `ORDER` clause. For more information, see [Performance tuning with ordered columnstore indexes](../../relational-databases/indexes/ordered-columnstore-indexes.md).
506
+
- In [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], [!INCLUDE [fabric-sqldb](../../includes/fabric-sqldb.md)], [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)], and [!INCLUDE [sql-server-2025](../../includes/sssql25-md.md)] can be ordered by including the `ORDER` clause. For more information, see [Performance tuning with ordered columnstore indexes](../../relational-databases/indexes/ordered-columnstore-indexes.md).
507
507
- Can't include LOB columns of type **nvarchar(max)**, **varchar(max)**, and **varbinary(max)** in nonclustered columnstore indexes. Only clustered columnstore indexes support LOB types, beginning in the [!INCLUDE [sssql17-md](../../includes/sssql17-md.md)] version, Azure SQL Database (configured at Premium tier, Standard tier (S3 and above), and all vCore offerings tiers). Prior versions don't support LOB types in clustered and nonclustered columnstore indexes.
508
508
- Starting with [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)], you can create a nonclustered columnstore index on an indexed view.
Copy file name to clipboardExpand all lines: docs/t-sql/statements/create-table-transact-sql.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -566,7 +566,7 @@ Specifies to create an index on the table. This can be a clustered index, or a n
566
566
567
567
Specifies to store the entire table in columnar format with a clustered columnstore index. This always includes all columns in the table. The data isn't sorted in alphabetical or numeric order since the rows are organized to gain columnstore compression benefits.
568
568
569
-
You can specify an order for the data in a clustered columnstore index starting with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], in [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], in [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)], and in [!INCLUDE [ssazuresynapse-md](../../includes/ssazuresynapse-md.md)]. For more information, see [Performance tuning with ordered columnstore indexes](../../relational-databases/indexes/ordered-columnstore-indexes.md).
569
+
You can specify an order for the data in a clustered columnstore index starting with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], in [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], in [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)], and in [!INCLUDE [ssazuresynapse-md](../../includes/ssazuresynapse-md.md)]. For more information, see [Performance tuning with ordered columnstore indexes](../../relational-databases/indexes/ordered-columnstore-indexes.md).
@@ -576,7 +576,7 @@ Specifies to create a nonclustered columnstore index on the table. The underlyin
576
576
577
577
The nonclustered columnstore index is stored and managed as a clustered columnstore index. It's called a nonclustered columnstore index to because the columns can be limited and it exists as a secondary index on a table.
578
578
579
-
You can specify an order for the data in a nonclustered columnstore index in [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)] and in [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)]. For more information, see [Performance tuning with ordered columnstore indexes](../../relational-databases/indexes/ordered-columnstore-indexes.md).
579
+
You can specify an order for the data in a nonclustered columnstore index in [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)] and in [!INCLUDE [ssazure-sqlmi-autd](../../includes/applies-to-version/ssazure-sqlmi-autd.md)]. For more information, see [Performance tuning with ordered columnstore indexes](../../relational-databases/indexes/ordered-columnstore-indexes.md).
0 commit comments