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

update table statistics permission defaults to the table owner and is not transferable. The command can also be executed by the Database Owner, who can impersonate the table owner by running the setuser command.

See also

Commands update all statistics, update index statistics, update statistics

Documentation Performance and Tuning Guide