Bug #32712 | ANALYZE TABLE takes a lot of time for MyISAM tables | ||
---|---|---|---|
Submitted: | 26 Nov 2007 11:16 | Modified: | 27 Nov 2007 21:44 |
Reporter: | Kristian Koehntopp | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S4 (Feature request) |
Version: | 5.0.46-enterprise-gpl-log | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[26 Nov 2007 11:16]
Kristian Koehntopp
[26 Nov 2007 11:19]
Kristian Koehntopp
Hmm, thinking about this, this might not work unmodified: The reason why index dives work for InnoDB is that they are INDEX and not DATA dives - if you drop down to the leaves of the PK in InnoDB at 10 different equidistant locations, you'll get a representative sample, because data in an index is ordered. Still, we can optimize this for MyISAM as well, if the MyISAM table has a primary key - if such a thing is present, we can copy the InnoDB behaviour and make Analyze fast.
[16 Jul 2009 9:41]
Andrii Nikitin
Alternatively, it would be great if ANALYZE has possibility to collect statistics without holding table lock for a long time. E.g. it can optionally perform several iterations (let's say for each 10% of table), holding lock only for each iteration. In this case accuracy may be worse but I think many users will be happy with such approach if lock is not held for long time.
[26 Jul 2009 11:30]
Valeriy Kravchuk
Bug #3865 was marked as a duplicate of this one.