EnumStatistics Method
Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.
The EnumStatistics method returns a QueryResults object that enumerates index statistics used to support Microsoft SQL Server query optimization.
구문
object
.EnumStatistics( )
as
QueryResults
Parts
- object
Expression that evaluates to an object in the Applies To list.
Prototype (C/C++)
HRESULT EnumStatistics(
LPSQLDMOQUERYRESULTS* ppResults);
Returns
A QueryResults object that contains three result sets. The first result set describes index statistics structure and age and is defined by these columns.
Column | Data type | Description |
---|---|---|
Average key length |
real |
Average length of an index row. |
Density |
real |
Selectivity of the index. |
Rows |
integer |
Number of rows in the table. |
Rows Sampled |
integer |
Number of rows sampled for statistics data. |
Steps |
integer |
Number of distribution steps. |
Updated |
nvarchar(21) |
Date and time of most recent update. |
The second result set describes index density and is defined by these columns.
Column | Data type | Description |
---|---|---|
All density |
real |
Selectivity of the column(s) listed in Columns. |
Columns |
nvarchar(129) |
Column(s) participating in index. |
The third result set enumerates histogram values and is defined by these columns.
Column | Data type | Description |
---|---|---|
Steps |
nvarchar(6) |
Histogram values in the current distribution statistics. |
주의
Statistics are calculated for an index when the index is first used in query optimization or at user direction. Statistics are updated automatically at configurable intervals. When statistics have not been calculated on an index, the EnumStatistics method succeeds but returns no result sets.