-
Bug
-
-
Major
-
Resolution:
Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
-
-
-
In 5.5.32 for the test case
create table t1 (a int) engine=myisam;
|
insert into t1 values (3), (1), (7);
|
|
create table t2 (b int, index idx(b));
|
insert into t2 values (2), (5), (3), (2);
|
|
explain select * from t1 where (select max(b) from t2) = 10;
|
explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
we had
MariaDB [test]> explain select * from t1 where (select max(b) from t2) = 10;
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| 1 | PRIMARY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE |
|
| 2 | SUBQUERY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Select tables optimized away |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
|
MariaDB [test]> explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| 1 | PRIMARY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE |
|
| 2 | SUBQUERY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Select tables optimized away |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
Yet after mdev-4817 (commit 04684b7709f55a5a9de9226e834bcfbed05ee5c0) we have
MariaDB [test]> explain select * from t1 where (select max(b) from t2) = 10;
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| 1 | PRIMARY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE |
|
| 2 | SUBQUERY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Select tables optimized away |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
2 rows in set (0.00 sec)
|
|
MariaDB [test]> explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
| 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 3 | Using where |
|
| 2 | SUBQUERY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Select tables optimized away |
|
+------+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
|
So we observe a performance regression.
{"report":{"fcp":1090.0999999046326,"ttfb":343.80000019073486,"pageVisibility":"visible","entityId":68854,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"2fe07466-8313-4ec8-bdf6-2bc74c24c27a","navigationType":0,"readyForUser":1174.9000000953674,"redirectCount":0,"resourceLoadedEnd":867.7000002861023,"resourceLoadedStart":352.5,"resourceTiming":[{"duration":137.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":352.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":352.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":489.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":137,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":352.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":352.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":489.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":242.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":353.09999990463257,"connectEnd":353.09999990463257,"connectStart":353.09999990463257,"domainLookupEnd":353.09999990463257,"domainLookupStart":353.09999990463257,"fetchStart":353.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":494.2000002861023,"responseEnd":595.7000002861023,"responseStart":512.9000000953674,"secureConnectionStart":353.09999990463257},{"duration":408.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":353.80000019073486,"connectEnd":353.80000019073486,"connectStart":353.80000019073486,"domainLookupEnd":353.80000019073486,"domainLookupStart":353.80000019073486,"fetchStart":353.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":494.59999990463257,"responseEnd":762.5999999046326,"responseStart":510.40000009536743,"secureConnectionStart":353.80000019073486},{"duration":157.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":354.09999990463257,"connectEnd":354.09999990463257,"connectStart":354.09999990463257,"domainLookupEnd":354.09999990463257,"domainLookupStart":354.09999990463257,"fetchStart":354.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":495.80000019073486,"responseEnd":511.80000019073486,"responseStart":509.40000009536743,"secureConnectionStart":354.09999990463257},{"duration":169.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":354.30000019073486,"connectEnd":354.30000019073486,"connectStart":354.30000019073486,"domainLookupEnd":354.30000019073486,"domainLookupStart":354.30000019073486,"fetchStart":354.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":504.80000019073486,"responseEnd":523.5,"responseStart":520.9000000953674,"secureConnectionStart":354.30000019073486},{"duration":169.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":354.5,"connectEnd":354.5,"connectStart":354.5,"domainLookupEnd":354.5,"domainLookupStart":354.5,"fetchStart":354.5,"redirectEnd":0,"redirectStart":0,"requestStart":505.30000019073486,"responseEnd":523.8000001907349,"responseStart":521.5999999046326,"secureConnectionStart":354.5},{"duration":155.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":354.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":510.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":178.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":354.80000019073486,"connectEnd":354.80000019073486,"connectStart":354.80000019073486,"domainLookupEnd":354.80000019073486,"domainLookupStart":354.80000019073486,"fetchStart":354.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":514.4000000953674,"responseEnd":533.2000002861023,"responseStart":531.2000002861023,"secureConnectionStart":354.80000019073486},{"duration":157.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":355,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":512.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":194.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":355.2000002861023,"connectEnd":355.2000002861023,"connectStart":355.2000002861023,"domainLookupEnd":355.2000002861023,"domainLookupStart":355.2000002861023,"fetchStart":355.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":534,"responseEnd":549.4000000953674,"responseStart":547.9000000953674,"secureConnectionStart":355.2000002861023},{"duration":485,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":356.80000019073486,"connectEnd":356.80000019073486,"connectStart":356.80000019073486,"domainLookupEnd":356.80000019073486,"domainLookupStart":356.80000019073486,"fetchStart":356.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":700.8000001907349,"responseEnd":841.8000001907349,"responseStart":837.4000000953674,"secureConnectionStart":356.80000019073486},{"duration":510.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":357,"connectEnd":357,"connectStart":357,"domainLookupEnd":357,"domainLookupStart":357,"fetchStart":357,"redirectEnd":0,"redirectStart":0,"requestStart":843.2000002861023,"responseEnd":867.7000002861023,"responseStart":864.9000000953674,"secureConnectionStart":357},{"duration":154.2999997138977,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":729.8000001907349,"connectEnd":729.8000001907349,"connectStart":729.8000001907349,"domainLookupEnd":729.8000001907349,"domainLookupStart":729.8000001907349,"fetchStart":729.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":843.9000000953674,"responseEnd":884.0999999046326,"responseStart":883.4000000953674,"secureConnectionStart":729.8000001907349},{"duration":168.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1005.5,"connectEnd":1005.5,"connectStart":1005.5,"domainLookupEnd":1005.5,"domainLookupStart":1005.5,"fetchStart":1005.5,"redirectEnd":0,"redirectStart":0,"requestStart":1140.9000000953674,"responseEnd":1174.4000000953674,"responseStart":1173.0999999046326,"secureConnectionStart":1005.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":179,"responseStart":344,"responseEnd":357,"domLoading":347,"domInteractive":1236,"domContentLoadedEventStart":1236,"domContentLoadedEventEnd":1278,"domComplete":1535,"loadEventStart":1535,"loadEventEnd":1535,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1219},{"name":"bigPipe.sidebar-id.end","time":1219.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1220},{"name":"bigPipe.activity-panel-pipe-id.end","time":1220.8000001907349},{"name":"activityTabFullyLoaded","time":1300.8000001907349}],"measures":[],"correlationId":"4f790793b71f28","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":87,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A fix for this bug was pushed to 5.5 and merged up to 10.2.
It should merged upstream as it is in 10.2.