You can use the UPDATE STATISTICS statement to gather statistics on a single index.
Purpose
The UPDATE STATISTICS
statement provides a syntax which enables you to analyze a single index.
With this syntax, the statement gathers statistics for all the index key expressions in the specified index.
This provides a shorthand so that you do not need to list all the index key expressions explicitly.
Syntax

For this syntax, UPDATE STATISTICS FOR
and ANALYZE
are synonyms.
The statement must begin with one of these alternatives.
index-clause | |
index-using | |
index-with |
INDEX Clause

For this syntax, the INDEX
clause enables you to specify the index name and a keyspace.
index-name |
A unique name that identifies the index. |
index-path | |
keyspace-ref |
Index Path




You can use a dotted notation to specify the index and the keyspace on which the index is built. Refer to the ALTER INDEX or DROP INDEX statements for details of the syntax.
Keyspace Reference



Alternatively, you can use the index name with the ON
keyword and a keyspace reference to specify the keyspace on which the index is built.
Refer to the ALTER INDEX or DROP INDEX statements for details of the syntax.
USING Clause

In Couchbase Server 6.5 and later, the index type for a secondary index must be Global Secondary Index (GSI).
The USING GSI
keywords are optional and may be omitted.
WITH Clause

Use the WITH
clause to specify additional options.
expr |
An object with the following properties:
|
Refer to Distribution Statistics for more information on sample size and resolution.