SQLServer:getTableStatistics

Gets information about the database table space used.

Type

SYNC, IMPACT_INFO

Arguments

Name

Type

Description

Table

String

Table name. Cannot be blank.

Target

String

The name of the object (index name or collection) for which to display statistics information. Target names must conform to the rules for identifiers. If the target is both an index name and a statistics collection name, both index and column statistics are returned. If no index or statistics collection is found with the specified name, an error is returned.

Cannot be blank.

Returns

Name

Type

Description

Updated

String

Date and time the last statistics were updated.

Rows

Integer

The number of rows in the table.

Rows Sampled

Integer

The number of rows sampled for statistics information.

Steps

Integer

The number of distribution steps.

Density

Double

The selectivity of the index.

Average Key Length

Double

The average length of the row.

Usage Notes

The results returned indicate the selectivity of an index (the lower the density returned, the higher the selectivity) and provide the basis for determining whether or not an index is useful to the optimizer. The results returned are based on distribution steps of the index. By using this method in a Hawk rulebase you can periodically monitor the table to confirm that space usage is appropriate.
Refer to the SHOW_STATISTICS DBCC statement for details.