In MySQL 5.6 we introduced a huge improvement in the way that index and table statistics are gathered by InnoDB and subsequently used by the Optimizer during query optimization: Persistent Statistics. Some aspects of the way that Persistent Statistics work could be improved further though, and we’d really like your input on that.
How much to sample?
The statistics are gathered by picking some pages semi-randomly,
analyzing them, and deriving some conclusions about the entire
table and/or index from those analyzed pages. The number of pages
sampled can be specified on a per-table basis with the
STATS_SAMPLE_PAGES clause. For example:
ALTER TABLE t STATS_SAMPLE_PAGES=500;
This way …