Inconsistent Statistic for Index

Symptom

There is an error message such as the following: Inconsistent statistic for index.

Cause

This error happens when the estimated number of distinct keys in an index is two times bigger than the table cardinality. This happens when accessing the data in the table, and sometimes is due to upgrading. The error message is of the form:

"Inconsistent statistics for index <SCHEMA>.<INDEX>.
Run ANALYZE to correct the problem."

Solution

Run ANALYZE on the index or table in question. See the documentation for the SQL statement ANALYZE.