Bug #68572 | FEDERATED using SHOW TABLE STATUS causes performance problems for InnoDB tables | ||
---|---|---|---|
Submitted: | 5 Mar 2013 10:57 | Modified: | 6 Mar 2013 19:46 |
Reporter: | Przemysław Ołtarzewski | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Federated storage engine | Severity: | S3 (Non-critical) |
Version: | 5.5.25a, 5.5.31 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | federated, performance, show table status |
[5 Mar 2013 10:57]
Przemysław Ołtarzewski
[5 Mar 2013 11:03]
MySQL Verification Team
Setting innodb_stats_on_metadata=0 in my.cnf should help avoid this issue, can you check as a possible workaround?
[5 Mar 2013 11:04]
Przemysław Ołtarzewski
Sample query profile for observed behavior: mysql> SELECT `ID`, `SUBSCRIBER_MSISDN`, `EXPIRY_DATE`, `TARIFF_ID`, `IN_SUBACCOUNT_ID` FROM `outpayment_account` WHERE ( (`SUBSCRIBER_MSISDN` LIKE '48604868674%') AND (`IN_SUBACCOUNT_ID` = '3') ) AND ( (1=1) AND (1=1) ); Empty set (14.50 sec) mysql> show profile for query 2; +------------------------------+-----------+ | Status | Duration | +------------------------------+-----------+ | starting | 0.000043 | | Waiting for query cache lock | 0.050245 | | checking permissions | 0.000023 | | Opening tables | 0.000031 | | System lock | 0.000020 | | Waiting for query cache lock | 0.050171 | | init | 0.000054 | | optimizing | 0.000030 | | statistics | 14.378236 | | preparing | 0.000031 | | executing | 0.000010 | | Sending data | 0.017192 | | end | 0.000017 | | query end | 0.000010 | | closing tables | 0.000012 | | freeing items | 0.000098 | | logging slow query | 0.000016 | | logging slow query | 0.000039 | | cleaning up | 0.000011 | +------------------------------+-----------+ 19 rows in set (0.00 sec)
[5 Mar 2013 11:22]
Przemysław Ołtarzewski
Shane, Thank you for quick suggestion. From what I've read about setting innodb_stats_on_metadata=0, this could be a viable workaround. However, I would like to know, what are the consequences of such configuration change. Will InnoDB statistics be ever rebuilt? Or do we need to execute ANALYZE TABLE manually on regular basis, using an event / job, to keep statistics up to date?
[6 Mar 2013 19:41]
Sveta Smirnova
Thank you for the feedback. You will need to execute ANALYZE TABLE manually on regular basis, using an event / job, to keep statistics up to date.
[6 Mar 2013 19:46]
Sveta Smirnova
At the same time bug verified as described using code analysis. However, this is more feature request for me, because these SHOW TABLE STATUS calls needed to get remote statistics about table.
[19 Feb 2014 16:19]
Eric Itzhak
the innodb_stats_on_metadata=0 parameter should be set in the localhost, remote host or both?