We had some performance issues after migrating SQL Server from windows server 2012 to windows server 2019 and after analysis, I found that I should do
sp_msforeachtable 'UPDATE STATISTICS? WITH FULLSCAN'
or do individual tables
This helped....
If you use FULLSCAN, it will read the entire table.
Question: When do you recommend using updated stats with FULLSCAN rather than default sampled?
Answer: When you know there is skew in the column.
Note: Skewed columns are columns in which the data is not evenly distributed among the rows.
Updating statistics ensures that queries compile with up-to-date statistics. Updating statistics via any process may cause query plans to recompile automatically.
No comments:
Post a Comment