Bug #68573 | 50ms query cache lock timeout not applied to SELECT statements correctly | ||
---|---|---|---|
Submitted: | 5 Mar 2013 12:57 | Modified: | 7 Jul 2017 9:08 |
Reporter: | Przemysław Ołtarzewski | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Query Cache | Severity: | S3 (Non-critical) |
Version: | 5.5.25a, 5.6.17 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | 50ms, lock timeout, query cache |
[5 Mar 2013 12:57]
Przemysław Ołtarzewski
[31 May 2013 8:26]
MySQL Verification Team
Hello Przemysław, Thank you for the report. Verified as described on reported and later versions. Thanks, Umesh
[31 May 2013 8:35]
MySQL Verification Team
How to repeat: // MySQLD startup bin/mysqld_safe --no-defaults --skip-gr --skip-na --console --core-file --basedir=/data/ushastry/server/mysql-5.5.32 --datadir=/tmp/69044_5532 --port=5532 --socket=/tmp/mysql.sock --query-cache-type=1 --query-cache-size=32M --innodb-flush-log-at-trx-commit=0 --innodb-buffer-pool-size=1000M --innodb-log-file-size=512M --innodb-file-per-table --innodb-support-xa=0 --innodb-checksums=0 --innodb-doublewrite=0 --user=mysql // Schema and load script use test; DROP TABLE IF EXISTS outpayment_account; CREATE TABLE `outpayment_account` ( `ID` int(11) DEFAULT NULL, `SUBSCRIBER_MSISDN` varchar(50) NOT NULL, `EXPIRY_DATE` datetime DEFAULT NULL, `TARIFF_ID` int(11) DEFAULT NULL, `IN_SUBACCOUNT_ID` varchar(50) DEFAULT NULL, `LAST_UPDATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY `UQ_ACCOUNT_MSISDN_SUBACCOUNT` (`SUBSCRIBER_MSISDN`,`IN_SUBACCOUNT_ID`), KEY `IDX_ACCOUNT_EXPIRY_DATE` (`EXPIRY_DATE`), KEY `SUBSCRIBER_MSISDN` (`SUBSCRIBER_MSISDN`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; set @id:=0; set @msisdn:=48604868674; set @tarrif_id:=0; insert into `outpayment_account` values (@id:=@id+1,@msisdn:=@msisdn+1,now(),@tarrif_id:=@tarrif_id+1,3,now()),(@id:=@id+1,@msisdn:=@msisdn+1,now(),@tarrif_id:=@tarrif_id+1,3,now()),(@id:=@id+1,@msisdn:=@msisdn+1,now(),@tarrif_id:=@tarrif_id+1,3,now()),(@id:=@id+1,@msisdn:=@msisdn+1,now(),@tarrif_id:=@tarrif_id+1,3,now()); insert into `outpayment_account` select @id:=@id+1,@msisdn:=@msisdn+1,now(),@tarrif_id:=@tarrif_id+1,3,now() from `outpayment_account` oa1 ,`outpayment_account` oa2 ,`outpayment_account` oa3 ,`outpayment_account` oa4 ,`outpayment_account` oa5 ,`outpayment_account` oak6 ,`outpayment_account` oa7 ,`outpayment_account` oa8 ,`outpayment_account` oa9 ,`outpayment_account` oa10 ,`outpayment_account` oa11 ,`outpayment_account` oa12 ,`outpayment_account` oa13 ,`outpayment_account` oa14 limit 25000000; /// Stress test query cache // Shane has written a script and shall pass on to you if you need /// 5.5.32 SELECT `ID`, `SUBSCRIBER_MSISDN`, `EXPIRY_DATE`, `TARIFF_ID`, `IN_SUBACCOUNT_ID` FROM `outpayment_account` WHERE ( (`SUBSCRIBER_MSISDN` LIKE '486048%') AND (`IN_SUBACCOUNT_ID` = '3') ) AND ( (1=1) AND (1=1) ); mysql> show profile for query 8; | Waiting for query cache lock | 0.000008 | | Waiting for query cache lock | 0.000008 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000009 | | Waiting for query cache lock | 0.000011 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000010 | | Waiting for query cache lock | 0.000009 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.001107 | | Waiting for query cache lock | 0.023118 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000007 | | Waiting for query cache lock | 0.000014 | | Waiting for query cache lock | 0.083513 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000011 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.066186 | | Waiting for query cache lock | 0.000010 | | Waiting for query cache lock | 0.000010 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.000007 | | Waiting for query cache lock | 0.013664 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.058520 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.000205 | | Waiting for query cache lock | 0.077533 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.048046 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000011 | | Waiting for query cache lock | 0.000005 | | Waiting for query cache lock | 0.000009 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.091037 | <----------- | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000010 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000009 | 100 rows in set (0.00 sec)
[31 May 2013 8:38]
MySQL Verification Team
Just to confirm that it is repeatable on 5.5.25a and on 5.5.32
[27 Feb 2014 8:31]
MySQL Verification Team
Latest 5.6 is also affected.. mysql> SHOW PROFILE FOR QUERY 5; | Waiting for query cache lock | 0.000007 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.092091 | | Waiting for query cache lock | 0.000007 | | Waiting for query cache lock | 0.000016 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.062547 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.108135 | | Waiting for query cache lock | 0.000007 | | Waiting for query cache lock | 0.001809 | | Waiting for query cache lock | 0.000011 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000007 | | Waiting for query cache lock | 0.000015 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000014 | | Waiting for query cache lock | 0.000014 | | Waiting for query cache lock | 0.000013 | | Waiting for query cache lock | 0.048075 | | Waiting for query cache lock | 0.016696 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000015 | | Waiting for query cache lock | 0.000474 | | Waiting for query cache lock | 0.066495 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.036373 | | Waiting for query cache lock | 0.082277 | | Waiting for query cache lock | 0.004116 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.069118 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000013 | | Waiting for query cache lock | 0.000012 | | Waiting for query cache lock | 0.123210 | | Waiting for query cache lock | 0.000012 | | Waiting for query cache lock | 0.071339 | | Waiting for query cache lock | 0.000011 | | Waiting for query cache lock | 0.000006 | | Waiting for query cache lock | 0.000013 | | Waiting for query cache lock | 0.000011 | | Waiting for query cache lock | 0.000015 | | Waiting for query cache lock | 0.000007 | | Waiting for query cache lock | 0.000014 | | Waiting for query cache lock | 0.063197 | | Waiting for query cache lock | 0.000013 | | Waiting for query cache lock | 0.000006 | 100 rows in set, 1 warning (0.00 sec)
[7 Jul 2017 9:08]
Erlend Dahl
MySQL will no longer invest in the query cache, see: http://mysqlserverteam.com/mysql-8-0-retiring-support-for-the-query-cache/