What is happening is that auto created statistics - are then being updated with a full scan. The full scan has to read all of the data for the table and it is taking a very long time to complete.I don't know how you have that coded, but if you are using the maintenance plan task you can set it up to do index statistics with full scan and column statistics with a sampling. If you start with this code: Select quotename(object_schema_name(ss.[object_id])) + '.' + quotename(object_name(ss.[object_id])) As ObjectName , quotename(ss.name) As StatsName , ss.auto_created , sp.last_updated , sp.[rows] , sp.rows_sampled From sys.stats ss Inner Join sys.objects so On so.[object_id] = ss.[object_id] Cross Apply sys.dm_db_stats_properties(ss.[object_id], ss.stats_id) sp Where so.[type] In ('U', 'IT') And sp.modification_counter > 0 And substring(object_name(ss.[object_id]), 1, 1) <> '#' And sp.last_updated < cast(dateadd(day, -1, getdate()) As datetime2(7)) Union --==== Include any stats that were auto updated with a sampling rate Select quotename(object_schema_name(ss.[object_id])) + '.' + quotename(object_name(ss.[object_id])) As ObjectName , quotename(ss.name) As StatsName , ss.auto_created , sp.last_updated , sp.[rows] , sp.rows_sampled From sys.stats ss Inner Join sys.objects so On so.[object_id] = ss.[object_id] Cross Apply sys.dm_db_stats_properties(ss.[object_id], ss.stats_id) sp Where so.[type] In ('U', 'IT') And ss.auto_created = 0 And sp.[rows] <> sp.rows_sampled Order By last_updated , ObjectName , StatsName;
This will get you a list of statistics and the last time they were updated. It identifies auto created and any statistics that were auto updated with a sampling rate. Using this, you can then decide how to update each statistic.