Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL) , 10.9(EOL) , 10.10(EOL)
CREATE TABLE t1 (i int );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (c int );
INSERT INTO t2 VALUES (3),(2),(3);
SELECT * FROM t1 WHERE i IN ( SELECT COUNT (*) OVER (PARTITION BY c) FROM t2 );
SET optimizer_switch= 'materialization=off' ;
SELECT * FROM t1 WHERE i IN ( SELECT COUNT (*) OVER (PARTITION BY c) FROM t2 );
MariaDB [test]> SELECT * FROM t1 WHERE i IN ( SELECT COUNT(*) OVER (PARTITION BY c) FROM t2 );
+------+
| i |
+------+
| 1 |
| 2 |
+------+
2 rows in set (0,000 sec)
MariaDB [test]> explain extended SELECT * FROM t1 WHERE i IN ( SELECT COUNT(*) OVER (PARTITION BY c) FROM t2 );
+------+--------------+-------------+--------+---------------+--------------+---------+-----------+------+----------+-----------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+--------------+-------------+--------+---------------+--------------+---------+-----------+------+----------+-----------------+
| 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | 100.00 | Using where |
| 1 | PRIMARY | <subquery2> | eq_ref | distinct_key | distinct_key | 8 | test.t1.i | 1 | 100.00 | Using where |
| 2 | MATERIALIZED | t2 | ALL | NULL | NULL | NULL | NULL | 3 | 100.00 | Using temporary |
+------+--------------+-------------+--------+---------------+--------------+---------+-----------+------+----------+-----------------+
3 rows in set, 1 warning (0,000 sec)
Note (Code 1003): /* select#1 */ select `test`.`t1`.`i` AS `i` from <materialize> (/* select#2 */ select count(0) over ( partition by `test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where `test`.`t1`.`i` = `<subquery2>`.`COUNT(*) OVER (PARTITION BY c)`
MariaDB [test]> set optimizer_switch='materialization=off';
Query OK, 0 rows affected (0,000 sec)
MariaDB [test]> SELECT * FROM t1 WHERE i IN ( SELECT COUNT(*) OVER (PARTITION BY c) FROM t2 );
Empty set (0,000 sec)
MariaDB [test]> explain extended SELECT * FROM t1 WHERE i IN ( SELECT COUNT(*) OVER (PARTITION BY c) FROM t2 );
+------+--------------------+-------+------+---------------+------+---------+------+------+----------+-----------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+--------------------+-------+------+---------------+------+---------+------+------+----------+-----------------+
| 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | 100.00 | Using where |
| 2 | DEPENDENT SUBQUERY | t2 | ALL | NULL | NULL | NULL | NULL | 3 | 100.00 | Using temporary |
+------+--------------------+-------+------+---------------+------+---------+------+------+----------+-----------------+
2 rows in set, 1 warning (0,001 sec)
Note (Code 1003): /* select#1 */ select `test`.`t1`.`i` AS `i` from `test`.`t1` where <expr_cache><`test`.`t1`.`i`>(<in_optimizer>(`test`.`t1`.`i`,<exists>(/* select#2 */ select count(0) over ( partition by `test`.`t2`.`c`) from `test`.`t2`)))
There are no comments yet on this issue.
{"report":{"fcp":1278.7999997138977,"ttfb":544.6999998092651,"pageVisibility":"visible","entityId":118255,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"76de0aee-bce6-4763-9009-b8597d70d2ba","navigationType":0,"readyForUser":1385,"redirectCount":0,"resourceLoadedEnd":1659.7999997138977,"resourceLoadedStart":554.2999997138977,"resourceTiming":[{"duration":173,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":554.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":554.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":727.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":172.90000009536743,"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":554.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":554.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":727.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":230,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":555,"connectEnd":555,"connectStart":555,"domainLookupEnd":555,"domainLookupStart":555,"fetchStart":555,"redirectEnd":0,"redirectStart":0,"requestStart":555,"responseEnd":785,"responseStart":785,"secureConnectionStart":555},{"duration":278.2000002861023,"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":558.1999998092651,"connectEnd":558.1999998092651,"connectStart":558.1999998092651,"domainLookupEnd":558.1999998092651,"domainLookupStart":558.1999998092651,"fetchStart":558.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":558.1999998092651,"responseEnd":836.4000000953674,"responseStart":836.4000000953674,"secureConnectionStart":558.1999998092651},{"duration":281.90000009536743,"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":558.6999998092651,"connectEnd":558.6999998092651,"connectStart":558.6999998092651,"domainLookupEnd":558.6999998092651,"domainLookupStart":558.6999998092651,"fetchStart":558.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":558.6999998092651,"responseEnd":840.5999999046326,"responseStart":840.5999999046326,"secureConnectionStart":558.6999998092651},{"duration":282.3999996185303,"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":558.9000000953674,"connectEnd":558.9000000953674,"connectStart":558.9000000953674,"domainLookupEnd":558.9000000953674,"domainLookupStart":558.9000000953674,"fetchStart":558.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":558.9000000953674,"responseEnd":841.2999997138977,"responseStart":841.2999997138977,"secureConnectionStart":558.9000000953674},{"duration":282.59999990463257,"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":559.0999999046326,"connectEnd":559.0999999046326,"connectStart":559.0999999046326,"domainLookupEnd":559.0999999046326,"domainLookupStart":559.0999999046326,"fetchStart":559.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":559.0999999046326,"responseEnd":841.6999998092651,"responseStart":841.6999998092651,"secureConnectionStart":559.0999999046326},{"duration":376.90000009536743,"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":559.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":559.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":936.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":282.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":559.5,"connectEnd":559.5,"connectStart":559.5,"domainLookupEnd":559.5,"domainLookupStart":559.5,"fetchStart":559.5,"redirectEnd":0,"redirectStart":0,"requestStart":559.5,"responseEnd":842.2999997138977,"responseStart":842.2999997138977,"secureConnectionStart":559.5},{"duration":376.80000019073486,"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":559.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":559.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":936.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":283.59999990463257,"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":559.6999998092651,"connectEnd":559.6999998092651,"connectStart":559.6999998092651,"domainLookupEnd":559.6999998092651,"domainLookupStart":559.6999998092651,"fetchStart":559.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":559.6999998092651,"responseEnd":843.2999997138977,"responseStart":843.2999997138977,"secureConnectionStart":559.6999998092651},{"duration":826,"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":561.4000000953674,"connectEnd":561.4000000953674,"connectStart":561.4000000953674,"domainLookupEnd":561.4000000953674,"domainLookupStart":561.4000000953674,"fetchStart":561.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":561.4000000953674,"responseEnd":1387.4000000953674,"responseStart":1387.4000000953674,"secureConnectionStart":561.4000000953674},{"duration":1098.3999996185303,"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":561.4000000953674,"connectEnd":561.4000000953674,"connectStart":561.4000000953674,"domainLookupEnd":561.4000000953674,"domainLookupStart":561.4000000953674,"fetchStart":561.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":561.4000000953674,"responseEnd":1659.7999997138977,"responseStart":1659.7999997138977,"secureConnectionStart":561.4000000953674},{"duration":439.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":948.1999998092651,"connectEnd":948.1999998092651,"connectStart":948.1999998092651,"domainLookupEnd":948.1999998092651,"domainLookupStart":948.1999998092651,"fetchStart":948.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":948.1999998092651,"responseEnd":1387.9000000953674,"responseStart":1387.9000000953674,"secureConnectionStart":948.1999998092651},{"duration":469.19999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1269.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1269.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1738.7999997138977,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":281,"responseStart":545,"responseEnd":561,"domLoading":549,"domInteractive":1687,"domContentLoadedEventStart":1687,"domContentLoadedEventEnd":1734,"domComplete":2450,"loadEventStart":2450,"loadEventEnd":2451,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1661.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1662.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1662.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1663.2999997138977},{"name":"activityTabFullyLoaded","time":1742.6999998092651}],"measures":[],"correlationId":"6c35767d938707","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":203,"dbReadsTimeInMs":10,"dbConnsTimeInMs":129,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}