Something appears to be wrong with processing of nested NULLIF in 10.1. The example below is exaggerated to the point of being senseless intentionally, to show the clear difference in query execution time.
10.1
|
MariaDB [test]> CREATE TABLE t1 (i INT);
|
Query OK, 0 rows affected (0.09 sec)
|
|
MariaDB [test]> INSERT INTO t1 VALUES (1),(2);
|
Query OK, 2 rows affected (0.00 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]>
|
MariaDB [test]> SELECT * FROM t1 WHERE
|
-> NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(
|
-> NULLIF(1,1),
|
-> NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(1,1),1),1),1),1),1),1),1),1),1)
|
-> ),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1);
|
Empty set (1 min 10.76 sec)
|
|
MariaDB [test]> select @@version;
|
+-----------------+
|
| @@version |
|
+-----------------+
|
| 10.1.12-MariaDB |
|
+-----------------+
|
1 row in set (0.00 sec)
|
MySQL 5.6
|
MySQL [test]> CREATE TABLE t1 (i INT);
|
Query OK, 0 rows affected (0.28 sec)
|
|
MySQL [test]> INSERT INTO t1 VALUES (1),(2);
|
Query OK, 2 rows affected (0.00 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
MySQL [test]>
|
MySQL [test]> SELECT * FROM t1 WHERE
|
-> NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(
|
-> NULLIF(1,1),
|
-> NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(1,1),1),1),1),1),1),1),1),1),1)
|
-> ),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1);
|
Empty set (0.02 sec)
|
|
MySQL [test]> select @@version;
|
+-----------+
|
| @@version |
|
+-----------+
|
| 5.6.28 |
|
+-----------+
|
1 row in set (0.00 sec)
|
10.0
|
MySQL [test]> CREATE TABLE t1 (i INT);
|
Query OK, 0 rows affected (0.28 sec)
|
|
MariaDB [test]> INSERT INTO t1 VALUES (1),(2);
|
Query OK, 2 rows affected (0.39 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]>
|
MariaDB [test]> SELECT * FROM t1 WHERE
|
-> NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(
|
-> NULLIF(1,1),
|
-> NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(1,1),1),1),1),1),1),1),1),1),1)
|
-> ),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1);
|
Empty set (0.02 sec)
|
|
MariaDB [test]> select @@version;
|
+-----------------+
|
| @@version |
|
+-----------------+
|
| 10.0.24-MariaDB |
|
+-----------------+
|
1 row in set (0.00 sec)
|
Test case
|
CREATE TABLE t1 (i INT);
|
INSERT INTO t1 VALUES (1),(2);
|
|
SELECT * FROM t1 WHERE
|
NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(
|
NULLIF(1,1),
|
NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(1,1),1),1),1),1),1),1),1),1),1)
|
),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1);
|
{"report":{"fcp":1021.5999999046326,"ttfb":289,"pageVisibility":"visible","entityId":56126,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"c96a2bd5-ef87-4d35-b928-b878795ed215","navigationType":0,"readyForUser":1147.2999997138977,"redirectCount":0,"resourceLoadedEnd":1887.3999996185303,"resourceLoadedStart":294.2999997138977,"resourceTiming":[{"duration":215,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":294.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":294.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":509.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":215.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":294.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":294.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":509.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":224.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":294.7999997138977,"connectEnd":294.7999997138977,"connectStart":294.7999997138977,"domainLookupEnd":294.7999997138977,"domainLookupStart":294.7999997138977,"fetchStart":294.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":294.7999997138977,"responseEnd":519.1999998092651,"responseStart":519.1999998092651,"secureConnectionStart":294.7999997138977},{"duration":277.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":294.8999996185303,"connectEnd":294.8999996185303,"connectStart":294.8999996185303,"domainLookupEnd":294.8999996185303,"domainLookupStart":294.8999996185303,"fetchStart":294.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":294.8999996185303,"responseEnd":572.3999996185303,"responseStart":572.3999996185303,"secureConnectionStart":294.8999996185303},{"duration":281.40000009536743,"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":295.09999990463257,"connectEnd":295.09999990463257,"connectStart":295.09999990463257,"domainLookupEnd":295.09999990463257,"domainLookupStart":295.09999990463257,"fetchStart":295.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":295.09999990463257,"responseEnd":576.5,"responseStart":576.5,"secureConnectionStart":295.09999990463257},{"duration":281.80000019073486,"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":295.2999997138977,"connectEnd":295.2999997138977,"connectStart":295.2999997138977,"domainLookupEnd":295.2999997138977,"domainLookupStart":295.2999997138977,"fetchStart":295.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":295.2999997138977,"responseEnd":577.0999999046326,"responseStart":577,"secureConnectionStart":295.2999997138977},{"duration":281.90000009536743,"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":295.59999990463257,"connectEnd":295.59999990463257,"connectStart":295.59999990463257,"domainLookupEnd":295.59999990463257,"domainLookupStart":295.59999990463257,"fetchStart":295.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":295.59999990463257,"responseEnd":577.5,"responseStart":577.5,"secureConnectionStart":295.59999990463257},{"duration":370.5,"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":295.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":666.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":282.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":295.8999996185303,"connectEnd":295.8999996185303,"connectStart":295.8999996185303,"domainLookupEnd":295.8999996185303,"domainLookupStart":295.8999996185303,"fetchStart":295.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":295.8999996185303,"responseEnd":578,"responseStart":578,"secureConnectionStart":295.8999996185303},{"duration":370.2999997138977,"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":296.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":296.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":666.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":282.40000009536743,"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":296.19999980926514,"connectEnd":296.19999980926514,"connectStart":296.19999980926514,"domainLookupEnd":296.19999980926514,"domainLookupStart":296.19999980926514,"fetchStart":296.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":296.19999980926514,"responseEnd":578.5999999046326,"responseStart":578.5999999046326,"secureConnectionStart":296.19999980926514},{"duration":595.1999998092651,"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":301.69999980926514,"connectEnd":301.69999980926514,"connectStart":301.69999980926514,"domainLookupEnd":301.69999980926514,"domainLookupStart":301.69999980926514,"fetchStart":301.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":301.69999980926514,"responseEnd":896.8999996185303,"responseStart":896.8999996185303,"secureConnectionStart":301.69999980926514},{"duration":1575.5,"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":301.7999997138977,"connectEnd":301.7999997138977,"connectStart":301.7999997138977,"domainLookupEnd":301.7999997138977,"domainLookupStart":301.7999997138977,"fetchStart":301.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":301.7999997138977,"responseEnd":1877.2999997138977,"responseStart":1877.2999997138977,"secureConnectionStart":301.7999997138977},{"duration":218.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":678.8999996185303,"connectEnd":678.8999996185303,"connectStart":678.8999996185303,"domainLookupEnd":678.8999996185303,"domainLookupStart":678.8999996185303,"fetchStart":678.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":678.8999996185303,"responseEnd":897.3999996185303,"responseStart":897.3999996185303,"secureConnectionStart":678.8999996185303},{"duration":912.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":965.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":965.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1878.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":911.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":966.6999998092651,"connectEnd":966.6999998092651,"connectStart":966.6999998092651,"domainLookupEnd":966.6999998092651,"domainLookupStart":966.6999998092651,"fetchStart":966.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":966.6999998092651,"responseEnd":1878.5,"responseStart":1878.5,"secureConnectionStart":966.6999998092651},{"duration":920.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":967.0999999046326,"connectEnd":967.0999999046326,"connectStart":967.0999999046326,"domainLookupEnd":967.0999999046326,"domainLookupStart":967.0999999046326,"fetchStart":967.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":967.0999999046326,"responseEnd":1887.3999996185303,"responseStart":1887.3999996185303,"secureConnectionStart":967.0999999046326},{"duration":887.0999999046326,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1011,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1011,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1898.0999999046326,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":119,"responseStart":288,"responseEnd":299,"domLoading":292,"domInteractive":1904,"domContentLoadedEventStart":1904,"domContentLoadedEventEnd":1952,"domComplete":2567,"loadEventStart":2567,"loadEventEnd":2568,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1883.7999997138977},{"name":"bigPipe.sidebar-id.end","time":1884.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1885},{"name":"bigPipe.activity-panel-pipe-id.end","time":1886.2999997138977},{"name":"activityTabFullyLoaded","time":1976}],"measures":[],"correlationId":"80b3b21cecff3b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Execution spends a lot of time in: