SHeinema
SHeinema

Reputation: 634

Azure SQL Database Column Statistics

I am having trouble finding documentation regarding column statistics on a Microsoft Azure SQL Server database. I noticed recently that query plans had warnings in SSMS due to missing column statistics. Further investigation revealed that 'Auto Create Statistics' and 'Auto Update Statistics' were turned off for our database.

I understand that with our local SQL databases statistics are important to performance in that they let the query analyzer make educated guesses about the cardinality of results. Are statistics still important in an Azure SQL database? Is there any documentation about best practices here? Are there cases where automatic statistics should be turned off?

Upvotes: 0

Views: 852

Answers (1)

David Browne - Microsoft
David Browne - Microsoft

Reputation: 89091

There is no difference between statistics in SQL Server and Azure SQL Database. Azure SQL Database is just a manged, and automatically-updated flavor of SQL Server. Here's the doc page: Statistics

Are there cases where automatic statistics should be turned off?

Rare cases. The vast majority of SQL Server databases rely on automatic creation and updates of statistic, perhaps augmented by scheduled index maintence.

Automatic statistics are created when needed, and will be created before the query that needs them can be optimized. Sometimes this can cause an unacceptable delay, so you would set them to create asynchronously, and let the query proceed without them, or rely on a manual process review and create needed indexes and statistics.

Upvotes: 2

Related Questions