derived_stat

Description

Returns derived statistics for the specified object and index.

Syntax

derived_stat({object_name | object_id}, {index_name | index_id}, “statistic”)

Parameters

object_name

is the name of the object you are interested in. If you do not specify a fully qualified object name, derived_stat searches the current database.

object_id

is an alternative to object_name, and is the object id of the object you are interested in. This must be in the current database

index_name

is the name of the index, belonging to the specified object that you are interested in.

index_id

is an alternative to index_name, and is the index id of the specified object that you are interested in

statistic

the derived statistic to be returned. Available statistics are:

Value

Returns

data page cluster ratio or dpcr

The data page cluster ratio for the object/index pair

index page cluster ratio or ipcr

The index page cluster ratio for the object/index pair

data row cluster ratio or drcr

The data row cluster ratio for the object/index pair

large io efficiency or lgio

The large io efficiency for the object/index pair

space utilization or sput

The space utilization for the object/index pair

Examples

Example 1

Selects the space utilization for the titleidind index of the titles table:

select derived_stat("titles", "titleidind", "space utilization")

Example 2

Selects the data page cluster ratio for index id 2 of the titles table. Note that you can use either "dpcr" or "data page cluster ratio":

select derived_stat("titles", 2, "dpcr")

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Only the table owner can execute derived_stat.

See also

Documents Performance and Tuning Guide for:

Utilities optdiag