Type:
Task
Priority:
Major
Resolution:
Fixed
Sprint:
10.2.2-2, 10.2.2-4
It is possible to do condition pushdown into non-mergable VIEWs or derived tables.
Example:
select ...
from
(select col1, max(col2) as max_val
from t2
group by t1 ) TBL
where
col1 !='foo' and max_val > 100
here, both parts of top-level select's WHERE clause can be pushed into derived table's HAVING clause.
Implementation challenges
Moving condition from one select into another changes the context which condition is used in.
Table condition pushdown produces strictest-possible conditions, but has a property that certain part of condition can be attached to multiple tables.
Doing the same thing here will cause trouble: if the same part of the condition is both in subquery's HAVING and in upper select's WHERE, it should e.g. automagically changes its used_tables() depending on what context we're looking at it from.
The solution to this is to do limited pushdown: only push down expressions that we can completely remove from upper query's WHERE.
Pushdown may also require adjustments to ref_pointer_array . Sanja and Igor seem to understand the details of this.
{"report":{"fcp":1110.5,"ttfb":445.7000002861023,"pageVisibility":"visible","entityId":54347,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"625224f4-d138-4bc4-9c67-becf9eb86990","navigationType":0,"readyForUser":1214.7000002861023,"redirectCount":0,"resourceLoadedEnd":1300.4000000953674,"resourceLoadedStart":450.80000019073486,"resourceTiming":[{"duration":153.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":450.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":450.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":604.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":153.19999980926514,"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":451.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":451.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":604.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":176.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":451.30000019073486,"connectEnd":451.30000019073486,"connectStart":451.30000019073486,"domainLookupEnd":451.30000019073486,"domainLookupStart":451.30000019073486,"fetchStart":451.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":451.30000019073486,"responseEnd":627.6000003814697,"responseStart":627.6000003814697,"secureConnectionStart":451.30000019073486},{"duration":306.40000009536743,"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":451.40000009536743,"connectEnd":451.40000009536743,"connectStart":451.40000009536743,"domainLookupEnd":451.40000009536743,"domainLookupStart":451.40000009536743,"fetchStart":451.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":451.40000009536743,"responseEnd":757.8000001907349,"responseStart":757.8000001907349,"secureConnectionStart":451.40000009536743},{"duration":310.2999997138977,"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":451.6000003814697,"connectEnd":451.6000003814697,"connectStart":451.6000003814697,"domainLookupEnd":451.6000003814697,"domainLookupStart":451.6000003814697,"fetchStart":451.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":451.6000003814697,"responseEnd":761.9000000953674,"responseStart":761.9000000953674,"secureConnectionStart":451.6000003814697},{"duration":310.59999990463257,"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":451.90000009536743,"connectEnd":451.90000009536743,"connectStart":451.90000009536743,"domainLookupEnd":451.90000009536743,"domainLookupStart":451.90000009536743,"fetchStart":451.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":451.90000009536743,"responseEnd":762.5,"responseStart":762.5,"secureConnectionStart":451.90000009536743},{"duration":310.7999997138977,"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":452.1000003814697,"connectEnd":452.1000003814697,"connectStart":452.1000003814697,"domainLookupEnd":452.1000003814697,"domainLookupStart":452.1000003814697,"fetchStart":452.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":452.1000003814697,"responseEnd":762.9000000953674,"responseStart":762.9000000953674,"secureConnectionStart":452.1000003814697},{"duration":325.80000019073486,"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":452.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":452.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":778.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":310.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":452.5,"connectEnd":452.5,"connectStart":452.5,"domainLookupEnd":452.5,"domainLookupStart":452.5,"fetchStart":452.5,"redirectEnd":0,"redirectStart":0,"requestStart":452.5,"responseEnd":763.4000000953674,"responseStart":763.4000000953674,"secureConnectionStart":452.5},{"duration":325.69999980926514,"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":452.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":452.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":778.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":311.2999997138977,"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":452.7000002861023,"connectEnd":452.7000002861023,"connectStart":452.7000002861023,"domainLookupEnd":452.7000002861023,"domainLookupStart":452.7000002861023,"fetchStart":452.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":452.7000002861023,"responseEnd":764,"responseStart":764,"secureConnectionStart":452.7000002861023},{"duration":573.9000000953674,"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":459,"connectEnd":459,"connectStart":459,"domainLookupEnd":459,"domainLookupStart":459,"fetchStart":459,"redirectEnd":0,"redirectStart":0,"requestStart":459,"responseEnd":1032.9000000953674,"responseStart":1032.9000000953674,"secureConnectionStart":459},{"duration":841.4000000953674,"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":459,"connectEnd":459,"connectStart":459,"domainLookupEnd":459,"domainLookupStart":459,"fetchStart":459,"redirectEnd":0,"redirectStart":0,"requestStart":459,"responseEnd":1300.4000000953674,"responseStart":1300.4000000953674,"secureConnectionStart":459},{"duration":506.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":790.9000000953674,"connectEnd":790.9000000953674,"connectStart":790.9000000953674,"domainLookupEnd":790.9000000953674,"domainLookupStart":790.9000000953674,"fetchStart":790.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":790.9000000953674,"responseEnd":1297.6000003814697,"responseStart":1297.6000003814697,"secureConnectionStart":790.9000000953674},{"duration":219.69999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1099.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1099.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1319,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":281,"responseStart":445,"responseEnd":450,"domLoading":448,"domInteractive":1378,"domContentLoadedEventStart":1378,"domContentLoadedEventEnd":1422,"domComplete":2345,"loadEventStart":2345,"loadEventEnd":2347,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1361.7000002861023},{"name":"bigPipe.sidebar-id.end","time":1362.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1362.7000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":1365.3000001907349},{"name":"activityTabFullyLoaded","time":1432.6000003814697}],"measures":[],"correlationId":"ba0dcc93a854cb","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":102,"dbReadsTimeInMs":14,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}