STORAGE.TABLE_STATISTICS_UPDATE_IN_ENTITY_RECREATE
Target database: Azure SQL Database, Azure Synapse SQL, Microsoft Fabric, Databricks SQL, Amazon Redshift
STORAGE.TABLE_STATISTICS_UPDATE_IN_ENTITY_RECREATE is used to control whether table statistics are updated in entity recreate. Entity recreation is triggered by the deployment of some entity changes.
See also:
Usage
STORAGE.TABLE_STATISTICS_UPDATE_IN_ENTITY_RECREATE: Boolean
Default: true
Notes
Table statistics can be created for tables and materialized views in supported target databases.
Examples
Azure SQL Database, Azure Synapse SQL, Microsoft Fabric:
Disable updating statistics in entity recreate
Update in entity recreate set to false:
STORAGE.TABLE_STATISTICS_UPDATE_IN_ENTITY_RECREATE: false
Table statistics have been previously defined for an entity and a deployment that triggers entity recreate is executed:
...
CREATE STATISTICS ...
WITH SAMPLE 0 ROWS;
When 0 ROWS is specified, the statistics object is created but it does not contain statistics data.
Databricks SQL: Enabling statistics update in entity recreate
Update in entity recreate set to true:
STORAGE.TABLE_STATISTICS_UPDATE_IN_ENTITY_RECREATE: true
Table statistics have been previously defined for an entity and a deployment that triggers entity recreate is executing also:
...
ANALYZE <schema>.<entity> COMPUTE STATISTICS <statistics attributes and options>;
Amazon Redshift: Enabling statistics update in entity recreate
Update in entity recreate set to true:
STORAGE.TABLE_STATISTICS_UPDATE_IN_ENTITY_RECREATE: true
Table statistics have been previously defined for an entity and a deployment that triggers entity recreate is executing also:
...
ANALYZE <schema>.<entity> (<specified_columns>);