May 2005
Intermediate to advanced
352 pages
14h 39m
English
ANALYZE TABLE
ANALYZE [LOCAL|NO_WRITE_TO_BINLOG] TABLEtable[,...]
Use this statement to analyze and
store the key distribution of a table. It works on BDB, InnoDB, and
MyISAM tables. Unless the NO_WRITE_TO_BINLOG
option is given, the statement is written to the binary log file. The
LOCAL option is synonymous.
ANALYZE TABLE workreq; +----------------------+---------+----------+----------+ | Table | Op | Msg_type | Msg_text | +----------------------+---------+----------+----------+ | workrequests.workreq | analyze | status | OK | +----------------------+---------+----------+----------+
The message type results can be status,
error, info, or
warning. If the table hasn't
changed since it was last analyzed, the message text will read
"Table is already up to
date" and the table
won't be analyzed. This statement is equivalent to
using myisamchk -a at the command line for MyISAM
tables.
Read now
Unlock full access