Our MySQL service has about 10000 tables. When we use Pt online schema change to change tables, MySQL memory grows rapidly. Query information_schema.key_ column_ usage can be seen in the slow log,the table is used to check the foreign key constraint SQL,like this:
SELECT table_schema, table_name FROM information_schema.key_column_usage WHERE referenced_table_schema=‘XXX’ AND referenced_table_name=‘XXX’;
After stopping Pt online schema change, we played back some SQL statements. The memory growth is very fast. Therefore, we think it is the memory growth caused by querying the table . The new version adds the parameter - [no] check foreign keys. We used the – nocheck-foreign-keys parameter to solve this problem, but the memory problem was not solved,why is there still query information_ schema.key_ column_ usage SQL statement in usage? This problem can be easily repeated. You can create tens of thousands of tables in the database. The MySQL version is 5.6, key_ column_ Usage is a MEM engine。
I am looking forward to your reply!