ENABLE_QUERY_STATS

Enables gathering of query stats for the index. To have query-related metadata stored for the index, use this procedure to enable collection of statistics on that index. You can only access the gathered metadata when ctx_output.enable_query_stats is turned on for the index.

Note: Accessing the query stats metadata only works when ctx_output.enable_query_stats is turned on for the index. Please see “CTX_REPORT.INDEX_STATS” for the list of gathered query stats metadata.

Syntax

ctx_output.enable_query_stats(
index_name IN VARCHAR2
);

index_name

The name of the index on which query stats collection is to be enabled.

Example

Turn on gathering of query stats for the index myindex.

CTX_OUTPUT.ENABLE_QUERY_STATS(myindex);

Notes

The information that shows whether query stats is enabled on an index is available in the views: CTX_INDEXES and CTX_USER_INDEXES under the column idx_query_stats_enabled, which is in both of these views. If query_stats is enabled for an index, then the column displays YES; if not, then the column displays NO.

The data corresponding to the query statistics will be stored in persistent dictionary tables. Once statistics has been enabled for a particular index, query statistics will be collected for that index from all sessions.

If you call this procedure for an index where query stats is already enabled, then an error is thrown.

Statistics collection has a minimal effect on query performance.

CTX_OUTPUT.DISABLE_QUERY_STATS

CTX_REPORT.INDEX_STATS”.