ANALYZE TABLE complexity for
InnoDB tables is dependent on:
The number of pages sampled, as defined by
innodb_stats_sample_pages.The number of indexed columns in a table
The number of partitions. If a table has no partitions, the number of partitions is considered to be 1.
Using these parameters, an approximate formula for estimating
ANALYZE TABLE complexity would be:
innodb_stats_sample_pages *
number of indexed columns in a table * number of partitions
Typically, the greater the resulting value, the greater the
execution time for ANALYZE TABLE.
For more information about the
innodb_stats_sample_pages
configuration parameter, see
Section 14.9.10, “Configuring Optimizer Statistics for InnoDB”.