update table statistics

Description

update table statistics updates statistics that are stored in systabstats table, such as rowcount, cluster ratios, and so on. update table statistics does not affect column statistics stored in sysstatistics.

Syntax

 update table statistics table_name
	[partition data_partition_name]
	[index_name [partition index_partition_name]]

Parameters

table_name

is the name of the table you are updating the statistics for.

data_partition_name

is the name of the data partition for which you are updating the statistics for. If you do not include this, table statistics for all the the data partitions are updated.

index_name

is the name of index associated with the partition.

index_partition_name

is the name of the index partition.

Examples

Example 1

Performs a table statistics update on the smallsales partition:

update table statistics titles partition smallsales

Example 2

Performs a table statistics update on all of the partitions in the titles table:

update table statistics titles

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

You must be the table owner or a user with update statistics permission on the table to run update table statistics.

See also

Commands update all statistics, update index statistics, update statistics

Documentation Performance and Tuning Guide