Frequently asked question
Code:
Script 1: List all table Index Statistics in current enterprise geodatabase.
USE [Database Name]
GO
SELECT
o.name AS TableName
, i.name AS IndexName
, i.type_desc AS IndexType
, STATS_DATE(i.[object_id], i.index_id) AS StatisticsDate
FROM
sys.indexes i
JOIN sys.objects o ON i.[object_id] = o.[object_id]
WHERE
o.type = 'U' --Only get indexes for User Created Tables
AND i.name IS NOT NULL
ORDER BY
o.name, i.type
Code:
Script 2: When were Index Statistics last updated?
USE [ArcSDE Database Name]
GO
SELECT
o.name, i.name AS [Index Name],
STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date],
s.auto_created, s.no_recompute, s.user_created
FROM
sys.objects AS o WITH (NOLOCK)
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON o.[object_id] = i.[object_id]
INNER JOIN sys.stats AS s WITH (NOLOCK)
ON i.[object_id] = s.[object_id]
AND i.index_id = s.stats_id
WHERE
o.[type] = 'U'
ORDER BY
STATS_DATE(i.[object_id], i.index_id) ASC;
Get help from ArcGIS experts
Download the Esri Support App