Configuring Optimizer Statistics for InnoDB 15.8.10 Configuring Optimizer Statistics for InnoDB 15.8.10.1 Configuring Persistent Optimizer Statistics Parameters Configuring Automatic Statistics Calculation for Persistent Optimizer Statistics 3131 The  innodb_stats_auto_recalc  variable, which is enabled by default, controls whether statistics are calculated automatically when a table undergoes changes to more than 10% of its rows. You can also If you prefer not to persist optimizer statistics to disk, see Section 15.8.10.2, “Configuring Non-Persistent Optimizer Statistics Parameters” Persistent statistics are stored in the  mysql.innodb_table_stats  and  mysql.innodb_index_stats tables. See InnoDB Persistent Statistics Tables. Formerly, optimizer statistics were cleared when restarting the server and after some other types of operations, and recomputed on the next table access. Consequently, different estimates could be produced when recalculating statistics leading to different choices in query execution plans and variation in query performance. Optimizer statistics are persisted to disk when  innodb_stats_persistent=ON  or when individual tables are defined with  STATS_PERSISTENT=1 .  innodb_stats_persistent  is enabled by default. The persistent optimizer statistics feature improves plan stability by storing statistics to disk and making them persistent across server restarts so that the optimizer is more likely to make consistent choices each time for a given query. This section also provides information about estimating  ANALYZE TABLE  complexity, which may be useful when attempting to achieve a balance between accurate statistics and  ANALYZE TABLE  execution time. Non-persistent optimizer statistics are cleared on each server restart and after some other operations, and recomputed on the next table access. As a result, different estimates could be produced when recomputing statistics, leading to different choices in execution plans and variations in query performance. The persistent optimizer statistics feature is enabled by default ( innodb_stats_persistent=ON ). Persistent optimizer statistics are persisted across server restarts, allowing for greater plan stability and more consistent query performance. Persistent optimizer statistics also provide control and flexibility with these additional benefits: This section describes how to configure persistent and non-persistent optimizer statistics for  InnoDB tables. •You can use the  innodb_stats_auto_recalc  configuration option to control whether statistics are updated automatically after substantial changes to a table. •You can use the  STATS_PERSISTENT ,  STATS_AUTO_RECALC , and  STATS_SAMPLE_PAGES  clauses with  CREATE TABLE  and  ALTER TABLE  statements to configure optimizer statistics for individual tables. •You can query optimizer statistics data in the  mysql.innodb_table_stats  and mysql.innodb_index_stats  tables. •You can view the  last_update  column of the  mysql.innodb_table_stats  and mysql.innodb_index_stats  tables to see when statistics were last updated. •You can manually modify the  mysql.innodb_table_stats  and  mysql.innodb_index_stats tables to force a specific query optimization plan or to test alternative plans without modifying the database.