Slow query on information_schema.tables

前端 未结 2 1678
醉酒成梦
醉酒成梦 2020-12-18 01:18

I run a set of self-developed applications on a typical shared hosting service offering. I moved from a static configured table list of allowed tables to one based on a lis

2条回答
  •  庸人自扰
    2020-12-18 02:00

    For those who may want a hack with a minor drawback: http://www.mysqlperformanceblog.com/2011/12/23/solving-information_schema-slowness/

    What it does is it disable some stats that get updated if you query the schema, more information here: http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_stats_on_metadata

    And to make things easier for lazy bums who don't want to read, you only need to make a change to a setting:

    innodb_stats_on_metadata=0
    

    You can do this in the config file or dynamically:

    mysql> set global innodb_stats_on_metadata=0;
    

提交回复
热议问题