(mysql.info.gz) ANALYZE TABLE
Info Catalog
(mysql.info.gz) Table maintenance SQL
(mysql.info.gz) Table maintenance SQL
(mysql.info.gz) BACKUP TABLE
13.5.2.1 `ANALYZE TABLE' Syntax
...............................
ANALYZE [LOCAL | NO_WRITE_TO_BINLOG] TABLE TBL_NAME [, TBL_NAME] ...
This statement analyzes and stores the key distribution for a table.
During the analysis, the table is locked with a read lock. This works
on `MyISAM' and `BDB' tables and (as of MySQL 4.0.13) `InnoDB' tables.
For `MyISAM' tables, this statement is equivalent to using `myisamchk
-a'.
MySQL uses the stored key distribution to decide the order in which
tables should be joined when you perform a join on something other than
a constant.
The statement returns a table with the following columns:
*Column* *Value*
`Table' The table name
`Op' Always `analyze'
`Msg_type' One of `status', `error', `info', or
`warning'
`Msg_text' The message
You can check the stored key distribution with the `SHOW INDEX'
statement. `SHOW INDEX' SHOW INDEX.
If the table hasn't changed since the last `ANALYZE TABLE' statement,
the table will not be analyzed again.
Before MySQL 4.1.1, `ANALYZE TABLE' statements are not written to the
binary log. As of MySQL 4.1.1, they are written to the binary log
unless the optional `NO_WRITE_TO_BINLOG' keyword (or its alias `LOCAL')
is used.
Info Catalog
(mysql.info.gz) Table maintenance SQL
(mysql.info.gz) Table maintenance SQL
(mysql.info.gz) BACKUP TABLE
automatically generated byinfo2html