Automatic Calculation of Distribution Statistics
- Index level statistics, equivalent to the statistics gathered by UPDATE STATISTICS in the LOW mode, are calculated for most types of indexes, including B-tree, Virtual Index Interface, and functional indexes.
- Column distribution statistics, equivalent to the distribution generated in the HIGH mode, for a non-opaque leading indexed column of an ordinary B-tree index. The resolution percentage is 1.0 if the table has fewer than a million rows, and 0.5 for larger table sizes.
These distribution statistics are available to the query optimizer when it designs query plans for the table on which the new index was created.
For composite key indexes, only distributions of the leading column are created implicitly by the CREATE INDEX statement.
- Indexes on columns of user-defined data types
- Indexes on columns of the built-in opaque data types (including BOOLEAN and LVARCHAR)
- R-tree indexes
- Attached indexes.
If the calculation of distribution statistics fails during the CREATE INDEX operation, the database server reports that failure in the error log, but continues to create the index.
Index: idx_01 on nita.foo STATISTICS CREATED AUTOMATICALLY: Column Distribution for: nita.foo.a Mode: MEDIUM Number of Bins: 101 Bin size: 100.0 Sort data: 0.3 MB Completed building distribution in: 0 minutes 33 seconds
See the description of the UPDATE STATISTICS statement for information about distribution statistics and about the difference between LOW mode and MEDIUM mode distributions.