Problem: Received below error while collecting statistics on a table PROD.SALES_RK_2016
SQL2314W Some statistics are in an inconsistent state. The newly collected “TABLE” statistics are inconsistent with the existing “INDEX” statistics.
Issuing RUNSTATS on the table only may result in a situation where the table level statistics are inconsistent with the already existing index level statistics.
Likewise, issuing RUNSTATS for indexes only or during index creation may leave table level statistics in an inconsistent state.
For example, if index level statistics are collected on a particular table and later a significant number of rows is deleted from this table, issuing RUNSTATS on the table only
may end up with the table cardinality less than FIRSTKEYCARD which is an inconsistent state.
Hence, Issue a RUNSTATS to collect both table level and index level statistics.
Below is the runstats command to collect both table and index statistics for SALES_RK_2016 table in PROD schema:
db2 “runstats on table PROD.SALES_RK_2016 with distribution and detailed indexes all”