innodb_stats_on_metadata
environment variable in the source database must be set to OFF
. innodb_stats_on_metadata
parameter is enabled, every time tables in the information_schema
metadatabase are queried, InnoDB will update the information_schema.statistics
table, causing slower access. After this parameter is disabled, access to the schema table can be faster.innodb_stats_on_metadata
parameter is ON
, and you need to change it to OFF
. On MySQL 5.6.6 or above, the default value is OFF
, which has no problem.Note:You can modify this parameter without restarting the database, but you need to close all business connections to the database. If the source database is a slave, you also need to restart the master/slave sync SQL thread to prevent current business connections from continuing writing data in the mode before modification.
innodb_stats_on_metadata
to OFF
.set global innodb_stats_on_metadata = OFF
show global variables like "%innodb_stats_on_metadata%";
The system should display a result similar to the following:mysql> show globle table status like '%innodb_stats_on_metadata%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| innodb_stats_on_metadata | OFF |
+--------------------------+----- -+
1 row in set (0.00 sec)
Was this page helpful?