microsoft:microsoft_sql_server:sql:performance:check_database_statistics
Microsoft - Microsoft SQL Server - SQL - Performance - Check Database Statistics
If the database statistics are not up to date, it will cause the query optimizer to not have the right information to build the best query plan.
EXEC sp_updatestats GO DBCC FREEPROCCACHE() GO
NOTE: The DBCC FREEPROCCACHE command clears the procedure cache so new plans can be built using the updated statistics.
microsoft/microsoft_sql_server/sql/performance/check_database_statistics.txt · Last modified: 2021/08/05 13:50 by peter