Why does full scan update statistics use 100% of CPU on SQL Server 2014 when it uses maybe 20% of CPU on SQL Server 2008 R2, for the same tables, with similar hardware capability?
I have been looking at MAXDOP
, other options, and really see nothing that stands out. I realize that there could be settings that could cause this, but the settings are very similar for both databases (for example, MAXDOP
is 4 for both, with both having multiple cores). Both are Enterprise Edition.
Is there something "different" in SQL Server 2014 versus SQL Server 2008 R2 that could explain this? I have the memory option at 90% for both servers. Any thoughts on what to look for?
I run update statistics with full (100%) scan once a week on two servers using SQL Server 2008 R2/SP3 and SQL Server 2014/SP2, and the databases have the same structure. On the 2008 R2 server the update stats of two very large tables takes several hours, which is what I expect, but the CPU stays under 20% or so utilization the entire time. On the 2014 server, though, the CPU goes to 100% for about 40 minutes. The tables are a bit smaller on the 2014 server. I see this by using SQL Monitor analysis menus.
Here is the output of the Ola log file on the 2014 SQL Server, CPU goes to 100% from about 2:10 to 2:45:
Date and time: 2017-06-24 02:10:20
Command: UPDATE STATISTICS [InVA].[dbo].[AuditField] [_WA_Sys_00000005_15502E78] WITH FULLSCAN
Outcome: Succeeded
Duration: 00:07:48
Date and time: 2017-06-24 02:18:08
Date and time: 2017-06-24 02:18:08
Command: UPDATE STATISTICS [InVA].[dbo].[AuditField] [_WA_Sys_00000006_15502E78] WITH FULLSCAN
Outcome: Succeeded
Duration: 00:32:22
Date and time: 2017-06-24 02:50:30
Here is the output of the Ola log file on the 2008 R2 SQL Server for the two stats above, but CPU goes to maybe 15%:
Date and time: 2017-06-24 03:30:32
Command: UPDATE STATISTICS [InGA].[dbo].[AuditField] [_WA_Sys_00000003_0425A276] WITH FULLSCAN
Outcome: Succeeded
Duration: 00:05:00
Date and time: 2017-06-24 03:35:32
Date and time: 2017-06-24 03:35:32
Command: UPDATE STATISTICS [InGA].[dbo].[AuditField] [_WA_Sys_00000004_0425A276] WITH FULLSCAN
Outcome: Succeeded
Duration: 00:52:31
Date and time: 2017-06-24 04:28:03
I cannot run them with server maxdop=1 since that eliminates all parallel plan generation, and that could hurt the application. I plan to go the opposite direction and increase it to 8 (there are 16 cores on the box) and see what happens. May go faster to reduce the length of time the CPU is pegged. This job runs while users are mostly gone.
tempdb
configuration the same? It can be used whileUPDATE STATISTICS
is running, so that could also be an issue.