I generally use the following MySQL INFORMATION_SCHEMA (I_S)
query to Calculate Your MySQL Database Size. This query and
most others that access the MySQL INFORMATION_SCHEMA can be very
slow to execute because they are not real tables and are not
governed by physical data, memory buffers and indexes for example
but rather internal MySQL data structures.
Mark Leith indicates in his post on innodb_stats_on_metadata that Innodb performs 8
random(ish) dives in to the index, when anybody accesses any of
SHOW TABLE STATUS, SHOW INDEX,
INFORMATION_SCHEMA.TABLES,INFORMATION_SCHEMA.STATISTICS for
InnoDB tables. This can have an effect on performance, especially
with a large number of Innodb tables, and a poor ratio of
innodb_buffer_pool_size to disk data+index footprint.
What is even more …
[Read more]