Compartir a través de


TABLE_STATISTICS Rowset

GUID: DBSCHEMA_TABLE_STATISTICS

Number of restriction columns: 7

Restriction columns: TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, STATISTICS_CATALOG, STATISTICS_SCHEMA, STATISTICS_NAME, STATISTICS_TYPE

Default sort order: TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, STATISTICS_CATALOG, STATISTICS_SCHEMA, STATISTICS_NAME, ORDINAL_POSITION

Description: The TABLE_STATISTICS rowset describes the available set of statistics on tables in the provider.

Note

This rowset is not related to the STATISTICS rowset. See additional information in Special-Purpose Rowsets and IOpenRowset::OpenRowset.

Column name

Type indicator

Description

TABLE_CATALOG

DBTYPE_WSTR

Catalog name of the table of this statistic. NULL if the provider does not support catalogs.

TABLE_SCHEMA

DBTYPE_WSTR

Schema name of the table. NULL if the provider does not support schemas.

TABLE_NAME

DBTYPE_WSTR

Table name.

STATISTICS_CATALOG

DBTYPE_WSTR

Catalog name of the statistic. NULL if the provider does not support catalogs.

STATISTICS_SCHEMA

DBTYPE_WSTR

Schema name of the statistic. NULL if the provider does not support schemas.

STATISTICS_NAME

DBTYPE_WSTR

Name of the statistic.

STATISTICS_TYPE

DBTYPE_UI2

Bit-mask specifying the kinds of statistics supported by this statistic:

DBSTAT_HISTOGRAM ? Indicates histogram support.

DBSTAT_COLUMN_CARDINALITY? Indicates column cardinality support.

DBSTAT_TUPLE_CARDINALITY ? Indicates tuple cardinality support.

NoteNote
Histograms correspond to only the first column for a multi-column statistic.

COLUMN_NAME

DBTYPE_WSTR

Name of the column that is part of this statistic.

COLUMN_GUID

DBTYPE_GUID

Column GUID. Providers that do not identify columns with GUIDs should return NULL for this column.

COLUMN_PROPID

DBTYPE_UI4

Column PROPID. Providers that do not associate PROPIDs with columns should return NULL for this column.

ORDINAL_POSITION

DBTYPE_UI4

Ordinal position of the column in the statistic starting with one.

SAMPLE_PCT

DBTYPE_UI2

Percentage of the base table's rows that were sampled to produce this statistic. NULL if not supported.

LAST_UPDATE_TIME

DBTYPE_DATE

The time when this statistic was last updated. NULL if not supported.

NO_OF_RANGES

DBTYPE_UI4

Number of ranges in histogram. NULL if histograms are not supported as part of this statistic.

COLUMN_CARDINALITY

DBTYPE_I8

Number of unique values of the specified column in the table. NULL if cardinality information is not available for this column.

TUPLE_CARDINALITY

DBTYPE_I8

Number of unique values of the tuple <c1, c2, ..., ci> in the table where c1, c2, ..., ci are the columns in the statistic as indicated by ORDINAL_POSITION 1, 2, ..., i, respectively. NULL if cardinality information is not available for this tuple.

TABLE_CARDINALITY

DBTYPE_I8

Number of rows in the table.

AVG_COLUMN_LENGTH

DBTYPE_UI4

The average length in bytes of the column in the table. This is required only for variable-length character or binary columns (of types DBTYPE_WSTR, DBTYPE_STR, DBTYPE_BYTES, and DBTYPE_VARNUMERIC) and is optional for fixed-length data types. NULL if the provider does not maintain this information.