MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.21k stars 21.37k forks source link

Creating statistics on every column #118460

Closed mljohn111 closed 4 months ago

mljohn111 commented 8 months ago

In this article, there is code provided that generates scripts to create user statistics on every column in a table. In SQL, this would not be considered a good practice, and there is nothing in any SQL Server documentation that would recommend this.

This Learn article is wholly misleading without any explanation about why you would want to create statistics on every column in a table. The testing I have performed on Synapse with statistics created on every column have actually hurt performance in more than half of my limited test scenarios. Simply, I took ~10 queries that are being executed against our Synapse instance. I created two sets of tables that were used in these queries, one set had stats created on every column and the other set were left as-is.

Measuring response times, 7 of these queries performed slower; 3 were almost double. The rest were about the same.

I seems as if there is no information throughout this article that indicates when and why you would want to do any of these things in your system.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Naveenommi-MSFT commented 8 months ago

@mljohn111 Thanks for your feedback! We will investigate and update as appropriate.

Naveenommi-MSFT commented 8 months ago

@filippopovic Could you please review add comments on this, update as appropriate.

Naveenommi-MSFT commented 8 months ago

@mljohn111 Thank you for bringing this to our attention. I've delegated this to content author @filippopovic, who will review it and offer their insightful opinions.

filippopovic commented 5 months ago

@Naveenommi-MSFT , please reassign this to @mstehrani . I wrote initial version of this article by reusing existing SQL DW documentation for "Statistics in dedicated SQL pool" section.

PesalaPavan commented 5 months ago

@mstehrani Kindly review this.

bandersmsft commented 4 months ago

Thanks for your dedication to our documentation. Unfortunately, at this time we have been unable to review your issue in a timely manner and we sincerely apologize for the delayed response. We are closing this issue for now, but if you feel that it's still a concern, please respond and let us know. If you determine another possible update to our documentation, please don't hesitate to reach out again. #please-close