Bug #20449 Information about ANALYZE of InnoDB tables is missing
Submitted: 14 Jun 2006 7:38 Modified: 20 Jun 2006 13:47
Reporter: Oli Sennhauser Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0 OS:n.a.
Assigned to: MC Brown CPU Architecture:Any

[14 Jun 2006 7:38] Oli Sennhauser
Information about ANALYZE of InnoDB tables is partially wrong, missing and/or incomplete.

How to repeat: ANALYZE TABLE Syntax

"During the analysis, the table is locked with a read lock." ==> This is NOT valid for InnoDB.

I found in the InnoDB documentation some text which describes the ANALYZE for InnoDB as follows:
"It makes 10 random dives to each of the index trees and updates index cardinality estimates accordingly. Note that since it is only an estimate, repeated runs of ANALYZE TABLE may produce different numbers. MySQL uses index cardinality estimates only in join optimization. If some join is not optimized in the right way, you may try using ANALYZE TABLE."

Suggested fix:
See above.
[14 Jun 2006 9:17] Valeriy Kravchuk
Thank you for a reasonable documentation request.
[20 Jun 2006 13:47] MC Brown
This has been addressed in the 4.1, 5.0 and 5.1 manuals. 

I've added a note that InnoDB ANALYZE is write-lock, not read. The additional info about how InnoDB actually does an ANAYLYZE already exists in the InnoDB docs, so I've added a link from the ANALYZE TABLE page to the corresponding area in the InnoDB documentation.