Bug #43968 | Show index has performance degradation as the table of focus increases in size | ||
---|---|---|---|
Submitted: | 30 Mar 2009 19:07 | Modified: | 5 Apr 2013 12:51 |
Reporter: | Edward Huang | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S4 (Feature request) |
Version: | 5.1.32, 5.1 bzr | OS: | Any (Linux and Windows) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[30 Mar 2009 19:07]
Edward Huang
[31 Mar 2009 9:30]
Sveta Smirnova
Thank you for the report. Verified as described. Strictly say some performance degradation is expected, because SHOW INDEX shows Cardinality which can vary for different data. But problem occurs only if storage engine is InnoDB, so I mark this as verified.
[31 Mar 2009 9:31]
Sveta Smirnova
results in my environment
Attachment: resutls.txt (text/plain), 15.38 KiB.
[31 Mar 2009 15:03]
Edward Huang
Is there a way to "SHOW INDEX..." without cardinality?
[31 Mar 2009 15:05]
Jon Leichter
I wonder if the SHOW INDEX command could be extended to include an option to NOT compute cardinality. The reason this bug was noticed was due to the long delays we experienced while using the getPrimaryKeys() method of the DatabaseMetaData class of the JDBC interface. During the long delay, I had sniffed the wire to see that under the covers JConnect was issuing a "SHOW KEYS" command (which is an alias of SHOW INDEX). If the underlying command were to not compute cardinality, the results would come back faster. Note that cardinality does NOT seem to be a return value from the getPrimaryKeys() method, which is why I'm bringing this up.
[3 Apr 2009 12:58]
Mikhail Izioumtchenko
Vasil, could you have a look? I wonder also if innodb_stats_on_metadata covers it.
[5 Mar 2013 12:37]
Vasil Dimov
Hmm, looks like this has been forgotten for a long time! The cardinality estimation does not depend on the size of the table, it always looks up a fixed number of pages. innodb_stats_on_metadata=0 will disable cardinality estimation during SHOW INDEX, can you try that one and see if the problem goes away? In 5.6+ with InnoDB persistent statistics, cardinality will not be calculated automatically during SHOW INDEX.
[12 Mar 2013 18:05]
Sveta Smirnova
Edward, please test in your environment. I can not repeat described behavior anymore since version 5.1.67. With innodb_stats_on_metadata=1 SHOW INDEX run a bit slower: 0.220s vs 0.010s, but there is no execution time increase.
[6 Apr 2013 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".