How to change innodb_stats_on_metadata in MySQL

innodb_stats_on_metadata – Lets you collect statistics on metadata operations such as SHOW TABLE STATUS when accessing INFORMATION_SCHEMA.TABLES or INFORMATION_SCHEMA.STATISTICS tables.
In newer versions of MySQL, the innodb_stats_on_metadata parameter is disabled by default, which makes working with these tables faster.

Let’s see the current value:

SHOW VARIABLES LIKE 'innodb_stats_on_metadata';

If the value is ON or 1 which means enabled, then disable:

SET GLOBAL innodb_stats_on_metadata = OFF;

See my other articles about MySQL

Leave a comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading