Creating statistics and automating the update of statistics
Statistics play a key role in maintaining the optimal performance of the queries in a Synapse dedicated SQL pool. For each query submitted, the query optimizer prepares a query plan that comprises several operations (such as filtering, joining, sorting, and more). Statistics inform the optimizer how many rows are expected to be returned for each of those operations, and based on the statistics input, the optimizer prepares query plans. So, for the query plans to be effective and performance to be optimal, we need good statistics.
In this recipe, we will learn how to create statistics and update statistics.
Getting ready
Create a Synapse Analytics workspace as explained in the Provisioning an Azure Synapse Analytics workspace recipe of Chapter 8, Processing Data Using Azure Synapse Analytics.
Complete the Loading data into dedicated SQL pools using PolyBase using T-SQL recipe to create a dedicated SQL pool named...