sys.stats (Transact-SQL)

Contains a row for each statistic of a tabular object of the type U, V, or TF.

Note

Every index will have a corresponding statistics row with the same name and ID (index_id = stats_id), but not every statistics row has a corresponding index.

Column name

Data type

Description

object_id

int

ID of the object to which these statistics belong.

name

sysname

Name of the statistics. Is unique within the object.

stats_id

int

ID of the statistics. Is unique within the object.

auto_created

bit

Statistics were auto-created by the query processor.

user_created

bit

Statistics were explicitly created by the user.

no_recompute

bit

Statistics were created with the NORECOMPUTE option.

has_filter

bit

1 = Statistics have a filter and are computed only on rows that satisfy the filter definition.

0 = Statistics do not have a filter and are computed on all rows.

filter_definition

nvarchar(max)

Expression for the subset of rows included in filtered statistics.

NULL = Non-filtered statistics.

Permissions

In SQL Server 2005 and later versions, the visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. For more information, see Metadata Visibility Configuration.