SET STATISTICS

From InterBase

Go Up to Statement and Function Reference (Language Reference Guide)


Recomputes the selectivity of a specified index. Available in gpre, DSQL, and isql.

SET STATISTICS INDEX name;
Important:
In SQL statements passed to DSQL, omit the terminating semicolon. In embedded applications written in C and C++, and in isql, the semicolon is a terminating symbol for the statement, so it must be included.
Argument Description

<name>

Name of an existing index for which to recompute selectivity

Description: SET STATISTICS enables the selectivity of an index to be recomputed. Index selectivity is a calculation, based on the number of distinct rows in a table, that is made by the InterBase optimizer when a table is accessed. It is cached in memory, where the optimizer can access it to calculate the optimal retrieval plan for a given query. For tables where the number of duplicate values in indexed columns radically increases or decreases, periodically recomputing index selectivity can improve performance.

Only the creator of an index can use SET STATISTICS.

Note:
SET STATISTICS does not rebuild an index. To rebuild an index, use ALTER INDEX.

Example: The following embedded SQL statement recomputes the selectivity for an index:

EXEC SQL
SET STATISTICS INDEX MINSALX;

See Also

Advance To: