Type:
New Feature
Priority:
Major
Resolution:
Unresolved
Fix Version/s:
None
Currently MariaDB does not allow to use lateral derived tables in queries though it
uses builds them internally for when employing split optimization.
Consider the following query
SELECT t.b FROM t1, LATERAL (SELECT * FROM t2 WHERE t1.a=t2.a) AS t
Here the reference t1.a in the WHERE condition of derived table t refers to the field a
of the table t1 used in the same FROM list as t.
SQL standard allows lateral derived tables and MySQL 8.0 supports them.
In MySQL the table can depend only on other tables in the same SELECT. If record in dependent table changes it invalidate table.
My idea is use Item_cache to store external references values on which current content of the table was generated.
Also maintain table map of dependence (including OUTER_REF_TABLE_BIT) and put check outer values/invalidate of the tables as we get and approved value executing the step in JOIN_TAB array processing (all dependent tables defined and got values in the records )
In case of only outer dependence do not forget "join->outer_ref_cond->val_int()" in do_select()
{"report":{"fcp":719.3000001907349,"ttfb":147.90000009536743,"pageVisibility":"visible","entityId":73591,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"146cab3e-3288-4324-99dc-c052e2d84cab","navigationType":0,"readyForUser":798.2000000476837,"redirectCount":0,"resourceLoadedEnd":624.6000001430511,"resourceLoadedStart":153.70000004768372,"resourceTiming":[{"duration":92.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":153.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":153.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":246,"responseStart":0,"secureConnectionStart":0},{"duration":92,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":154,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":154,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":246,"responseStart":0,"secureConnectionStart":0},{"duration":100.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":154.10000014305115,"connectEnd":154.10000014305115,"connectStart":154.10000014305115,"domainLookupEnd":154.10000014305115,"domainLookupStart":154.10000014305115,"fetchStart":154.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":154.10000014305115,"responseEnd":254.90000009536743,"responseStart":254.90000009536743,"secureConnectionStart":154.10000014305115},{"duration":166.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":154.20000004768372,"connectEnd":154.20000004768372,"connectStart":154.20000004768372,"domainLookupEnd":154.20000004768372,"domainLookupStart":154.20000004768372,"fetchStart":154.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":154.20000004768372,"responseEnd":320.90000009536743,"responseStart":320.90000009536743,"secureConnectionStart":154.20000004768372},{"duration":169.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":154.40000009536743,"connectEnd":154.40000009536743,"connectStart":154.40000009536743,"domainLookupEnd":154.40000009536743,"domainLookupStart":154.40000009536743,"fetchStart":154.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":154.40000009536743,"responseEnd":324,"responseStart":324,"secureConnectionStart":154.40000009536743},{"duration":170.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":154.40000009536743,"connectEnd":154.40000009536743,"connectStart":154.40000009536743,"domainLookupEnd":154.40000009536743,"domainLookupStart":154.40000009536743,"fetchStart":154.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":154.40000009536743,"responseEnd":324.5,"responseStart":324.5,"secureConnectionStart":154.40000009536743},{"duration":172.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":154.5,"connectEnd":154.5,"connectStart":154.5,"domainLookupEnd":154.5,"domainLookupStart":154.5,"fetchStart":154.5,"redirectEnd":0,"redirectStart":0,"requestStart":154.5,"responseEnd":327.10000014305115,"responseStart":327.10000014305115,"secureConnectionStart":154.5},{"duration":172.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":154.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":154.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":327.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":172.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":154.80000019073486,"connectEnd":154.80000019073486,"connectStart":154.80000019073486,"domainLookupEnd":154.80000019073486,"domainLookupStart":154.80000019073486,"fetchStart":154.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":154.80000019073486,"responseEnd":327.60000014305115,"responseStart":327.60000014305115,"secureConnectionStart":154.80000019073486},{"duration":173.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":154.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":154.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":328,"responseStart":0,"secureConnectionStart":0},{"duration":173.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":155,"connectEnd":155,"connectStart":155,"domainLookupEnd":155,"domainLookupStart":155,"fetchStart":155,"redirectEnd":0,"redirectStart":0,"requestStart":155,"responseEnd":328.2000000476837,"responseStart":328.2000000476837,"secureConnectionStart":155},{"duration":422.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":156.30000019073486,"connectEnd":156.30000019073486,"connectStart":156.30000019073486,"domainLookupEnd":156.30000019073486,"domainLookupStart":156.30000019073486,"fetchStart":156.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":156.30000019073486,"responseEnd":578.7000000476837,"responseStart":578.7000000476837,"secureConnectionStart":156.30000019073486},{"duration":468.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":156.40000009536743,"connectEnd":156.40000009536743,"connectStart":156.40000009536743,"domainLookupEnd":156.40000009536743,"domainLookupStart":156.40000009536743,"fetchStart":156.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":156.40000009536743,"responseEnd":624.6000001430511,"responseStart":624.6000001430511,"secureConnectionStart":156.40000009536743},{"duration":145.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":467.60000014305115,"connectEnd":467.60000014305115,"connectStart":467.60000014305115,"domainLookupEnd":467.60000014305115,"domainLookupStart":467.60000014305115,"fetchStart":467.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":467.60000014305115,"responseEnd":613.3000001907349,"responseStart":613.3000001907349,"secureConnectionStart":467.60000014305115}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":15,"responseStart":148,"responseEnd":152,"domLoading":151,"domInteractive":862,"domContentLoadedEventStart":862,"domContentLoadedEventEnd":903,"domComplete":1859,"loadEventStart":1859,"loadEventEnd":1861,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":840.9000000953674},{"name":"bigPipe.sidebar-id.end","time":841.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.start","time":841.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":844.4000000953674},{"name":"activityTabFullyLoaded","time":915.9000000953674}],"measures":[],"correlationId":"60da0d7a0f8bef","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":78,"dbReadsTimeInMs":14,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}