• MySQL uses cost based optimizer – therefore depends on server statistics
  • show statistics:
    • table INFORMATION_SCHEMA:STATISTICS shows basic statistics
    • SHOW TABLE STATUS
    • SHOW INDEX
  • InnoDB:
    • uses by default samples for computing statistics
    • default number of data pages being examined is 8 in older versions
    • parameter “innodb_stats_sample_pages” sets number of data pages for statistics in recent versions