-
Notifications
You must be signed in to change notification settings - Fork 132
Analyze Table
When analyze table is executed on a TokuDB table, TokuDB computes the cardinality of the data stored in the table and makes the cardinality data available to the MySQL query optimizer. See the Cardinality wiki for details on the algorithm used to compute cardinality.
MySQL 5.5 schedules analyze table with a shared read meta data lock. The MDL_SHARED_READ and TL_READ_NO_INSERT meta data locking levels are used. This lock allows concurrent reads to the table, but prohibits concurrent writes to the table, while the table is being analyzed.
Analyze table scans a bunch of rows from the table to compute cardinality. Since this scan can take some time, TokuDB periodically updates the processlist info for the client running analyze table with an estimate of how much progress the analyze table has made since it started. The progress is computed based on the percentage of rows examined and the percentage of time allowed.