Perform post load optimization

Completed

After loading new data into the data warehouse, it's a good idea to rebuild the table indexes and update statistics on commonly queried columns.

Rebuild indexes

The following example rebuilds all indexes on the DimProduct table.

ALTER INDEX ALL ON dbo.DimProduct REBUILD

Tip

For more information about rebuilding indexes, see the Indexes on dedicated SQL pool tables in Azure Synapse Analytics article in the Azure Synapse Analytics documentation.

Update statistics

The following example creates statistics on the ProductCategory column of the DimProduct table:

CREATE STATISTICS productcategory_stats
ON dbo.DimProduct(ProductCategory);

Tip

For more information about updating statistics, see the Table statistics for dedicated SQL pool in Azure Synapse Analytics article in the Azure Synapse Analytics documentation.