Home Forums SQL Server 2012 SQL 2012 - General SQL Server 2012, update Stats and Index Organize taking 16 hours for execution RE: SQL Server 2012, update Stats and Index Organize taking 16 hours for execution??
February 22, 2018 at 7:50 am
andrew gothard - Tuesday, February 20, 2018 3:14 AMHi.
One thing I would look for is whether any of the legacy LoB datatypes are used in any of the tables, text, ntext and image. I have seen a number of cases where their use, especially on large tables, causes this type of problem, particularly with stats updates.
Try running this;
SELECT
Schemas.name + '.' + Tables.name TableName, Columns.Name ColumnName, Types.Name DataType
FROM
sys.schemas Schemas
INNER JOIN
sys.tables Tables
ON Schemas.schema_id = Tables.schema_id
INNER JOIN
sys.stats Stats
ON Tables.object_id = Stats.object_id
INNER JOIN
sys.stats_columns StatsColumns
ON Stats.object_id = StatsColumns.object_id AND
Stats.stats_id = StatsColumns.stats_id
INNER JOIN
sys.columns Columns
ON StatsColumns.object_id = Columns.object_id AND
StatsColumns.column_id = Columns.column_id
INNER JOIN
sys.types AS Types
ON Columns.system_type_id = Types.system_type_id
WHERE
Types.name IN ('image', 'ntext', 'text')
If so, if you can get back with your results, that'd be helpful
No there are no objects with image or ntext or text.