Index Statistics (Stats v2
)
Statistics can be generated for all indexed columns. Statistics generated for indexed columns are known as Index Statistics. Index statistics gather the following information:
-
Table cardinality
-
Index prefix scalar statistics:
-
Number of distinct values
-
Null count
-
-
Histograms, which provide data about the distribution of values in a column or across multiple columns in an index.
How to generate Index Statistics
Index Statistics are generated in one of two ways:
-
User runs the
ANALYZE
command -
The system incrementally updates the Index Statistics after a change occurs to the index
It is possible to disable automatic Index Statistics generation using the stats-v2-collection
database option.
When disabled, Index Statistics will only be generated using the ANALYZE
command.
|
How to enable Index Statistics
Table Statistics (Stats v3
) are enabled by default.
To revert back to Index Statistics (Stats v2
):
Please contact NuoDB Support before proceeding. |
-
Set the
stats-version
database option tov2
on all NuoDB engines. -
Set the
stats-v2-collection
database option toenable
on all NuoDB engines. -
For all schemas in the database, execute
analyze all tables in schema <schema>
, including theSYSTEM
schema.