Configuring Optimizer Statistics for InnoDB • n_cols_in_non_uniq_i  is the total number of all columns in all nonunique indexes • n_cols_in_pk  is the number of columns in the primary key (if a primary key is not defined,  InnoDB creates a single column primary key internally) • n_non_uniq_i  is the number of nonunique indexes in the table • n_part  is the number of partitions. If no partitions are defined, the table is considered to be a single partition. 3141 Based on the index statistics data shown above and the table definition, the following values can be determined: For additional information about the  InnoDB  persistent statistics tables, see Section 15.8.10.1, “Configuring Persistent Optimizer Statistics Parameters” For the column and index data required by the algorithm described above, query the mysql.innodb_index_stats  persistent index statistics table for table  t . The  n_diff_pfx%  statistics show the columns that are counted for each index. For example, columns  a  and  b  are counted for the primary key index. For the nonunique indexes, the primary key columns (a,b) are counted in addition to the user defined columns. Now, consider the following table (table  t ), which has a primary key (2 columns), a unique index (2 columns), and two nonunique indexes (two columns each): CREATE TABLE t ( a INT, b INT, c INT, d INT, e INT, f INT, g INT, h INT, PRIMARY KEY (a, b), UNIQUE KEY i1uniq (c, d), KEY i2nonuniq (e, f), KEY i3nonuniq (g, h) ); mysql>  SELECT index_name, stat_name, stat_description FROM mysql.innodb_index_stats WHERE database_name=’test’ AND table_name=’t’ AND stat_name like ’n_diff_pfx%’; +------------+--------------+------------------+ | index_name | stat_name | stat_description | +------------+--------------+------------------+ | PRIMARY | n_diff_pfx01 | a | | PRIMARY | n_diff_pfx02 | a,b | | i1uniq | n_diff_pfx01 | c | | i1uniq | n_diff_pfx02 | c,d | | i2nonuniq | n_diff_pfx01 | e | | i2nonuniq | n_diff_pfx02 | e,f | | i2nonuniq | n_diff_pfx03 | e,f,a | | i2nonuniq | n_diff_pfx04 | e,f,a,b | | i3nonuniq | n_diff_pfx01 | g | | i3nonuniq | n_diff_pfx02 | g,h | | i3nonuniq | n_diff_pfx03 | g,h,a | | i3nonuniq | n_diff_pfx04 | g,h,a,b | +------------+--------------+------------------+ Note