It's interesting that if one defines a VIEW instead of the CTE and uses it multiple times, both MariaDB and MySQL will materialize the view as many times as it is used.
One can say that sharing the CTE may interfere with other optimizations, like derived condition pushdown or derived_with_keys, or Split-Materialized.
A suggestion off the top of the head: if neither of these optimizations were employed, can we still re-use the CTE?
[{"id":-1,"name":"My open issues","jql":"assignee = currentUser() AND resolution = Unresolved order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":true},{"id":-2,"name":"Reported by me","jql":"reporter = currentUser() order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":true},{"id":-4,"name":"All issues","jql":"order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-5,"name":"Open issues","jql":"resolution = Unresolved order by priority DESC,updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-9,"name":"Done issues","jql":"statusCategory = Done order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-3,"name":"Viewed recently","jql":"issuekey in issueHistory() order by lastViewed DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-6,"name":"Created recently","jql":"created >= -1w order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-7,"name":"Resolved recently","jql":"resolutiondate >= -1w order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-8,"name":"Updated recently","jql":"updated >= -1w order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false}]
0.3
0
{"report":{"fcp":880.5999999046326,"ttfb":202.30000019073486,"pageVisibility":"visible","key":"jira.issue.nav-detail","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"d43335d8-2b86-49b0-bd56-d575e5fa00fe","navigationType":0,"readyForUser":1429,"redirectCount":0,"resourceLoadedEnd":480.09999990463257,"resourceLoadedStart":213.5,"resourceTiming":[{"duration":100.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":213.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":314.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":101,"initiatorType":"link","name":"https://jira.mariadb.org/s/1478ee9518804fac4b35845dc4ce556a-CDN/lu2cib/820016/12ta74/97a9a6b13407d4702f4a258757d43f81/_/download/contextbatch/css/jira.view.issue,viewissue.standalone,jira.navigator.kickass,jira.general,jira.global,jira.navigator,atl.general,jira.navigator.simple,jira.navigator.advanced,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":213.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":314.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":103.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/3.0.4/_/download/batch/com.atlassian.jira.jira-tzdetect-plugin:tzdetect-banner-component/com.atlassian.jira.jira-tzdetect-plugin:tzdetect-banner-component.css","startTime":214,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":317.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":103.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/a7c82c2f9b4c8fd63530eb9f2a1d712a-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.filter.deletion.warning:styles/jira.filter.deletion.warning:styles.css","startTime":214.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":317.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":215.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":214.5,"connectEnd":214.5,"connectStart":214.5,"domainLookupEnd":214.5,"domainLookupStart":214.5,"fetchStart":214.5,"redirectEnd":0,"redirectStart":0,"requestStart":318.5,"responseEnd":430,"responseStart":336.7000002861023,"secureConnectionStart":214.5},{"duration":264.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/3e25a0b0c47560558d0a6707b047e06f-CDN/lu2cib/820016/12ta74/97a9a6b13407d4702f4a258757d43f81/_/download/contextbatch/js/jira.view.issue,viewissue.standalone,jira.navigator.kickass,jira.general,jira.global,jira.navigator,atl.general,jira.navigator.simple,jira.navigator.advanced,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":215.2000002861023,"connectEnd":215.2000002861023,"connectStart":215.2000002861023,"domainLookupEnd":215.2000002861023,"domainLookupStart":215.2000002861023,"fetchStart":215.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":320.2000002861023,"responseEnd":480.09999990463257,"responseStart":347.5,"secureConnectionStart":215.2000002861023},{"duration":124.59999990463257,"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":215.5,"connectEnd":215.5,"connectStart":215.5,"domainLookupEnd":215.5,"domainLookupStart":215.5,"fetchStart":215.5,"redirectEnd":0,"redirectStart":0,"requestStart":321.59999990463257,"responseEnd":340.09999990463257,"responseStart":338.40000009536743,"secureConnectionStart":215.5},{"duration":124.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/aa6a6199803063cf5eed6122dfa3f13b-CDN/lu2cib/820016/12ta74/3.0.4/_/download/batch/com.atlassian.jira.jira-tzdetect-plugin:tzdetect-banner-component/com.atlassian.jira.jira-tzdetect-plugin:tzdetect-banner-component.js?locale=en","startTime":215.7000002861023,"connectEnd":215.7000002861023,"connectStart":215.7000002861023,"domainLookupEnd":215.7000002861023,"domainLookupStart":215.7000002861023,"fetchStart":215.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":321.80000019073486,"responseEnd":340.59999990463257,"responseStart":339,"secureConnectionStart":215.7000002861023},{"duration":128.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/3.0.4/_/download/batch/com.atlassian.jira.jira-tzdetect-plugin:tzdetect-lib/com.atlassian.jira.jira-tzdetect-plugin:tzdetect-lib.js","startTime":215.80000019073486,"connectEnd":215.80000019073486,"connectStart":215.80000019073486,"domainLookupEnd":215.80000019073486,"domainLookupStart":215.80000019073486,"fetchStart":215.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":324.09999990463257,"responseEnd":344.2000002861023,"responseStart":342.40000009536743,"secureConnectionStart":215.80000019073486},{"duration":128.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":216,"connectEnd":216,"connectStart":216,"domainLookupEnd":216,"domainLookupStart":216,"fetchStart":216,"redirectEnd":0,"redirectStart":0,"requestStart":324.40000009536743,"responseEnd":344.59999990463257,"responseStart":343.2000002861023,"secureConnectionStart":216},{"duration":129.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":216.2000002861023,"connectEnd":216.2000002861023,"connectStart":216.2000002861023,"domainLookupEnd":216.2000002861023,"domainLookupStart":216.2000002861023,"fetchStart":216.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":325.59999990463257,"responseEnd":345.80000019073486,"responseStart":344.90000009536743,"secureConnectionStart":216.2000002861023},{"duration":108.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":216.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":216.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":325.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":135.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":216.40000009536743,"connectEnd":216.40000009536743,"connectStart":216.40000009536743,"domainLookupEnd":216.40000009536743,"domainLookupStart":216.40000009536743,"fetchStart":216.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":335.2000002861023,"responseEnd":352.2000002861023,"responseStart":351.2000002861023,"secureConnectionStart":216.40000009536743},{"duration":224.09999990463257,"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":218.90000009536743,"connectEnd":218.90000009536743,"connectStart":218.90000009536743,"domainLookupEnd":218.90000009536743,"domainLookupStart":218.90000009536743,"fetchStart":218.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":335.5,"responseEnd":443,"responseStart":439.59999990463257,"secureConnectionStart":218.90000009536743},{"duration":225.40000009536743,"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":219,"connectEnd":219,"connectStart":219,"domainLookupEnd":219,"domainLookupStart":219,"fetchStart":219,"redirectEnd":0,"redirectStart":0,"requestStart":378.40000009536743,"responseEnd":444.40000009536743,"responseStart":441.80000019073486,"secureConnectionStart":219},{"duration":574.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":666.0999999046326,"connectEnd":666.0999999046326,"connectStart":666.0999999046326,"domainLookupEnd":666.0999999046326,"domainLookupStart":666.0999999046326,"fetchStart":666.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1206.7000002861023,"responseEnd":1240.5999999046326,"responseStart":1240,"secureConnectionStart":666.0999999046326},{"duration":417.40000009536743,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":863,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":863,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1280.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":414.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/api/2/filter/favourite?expand=subscriptions[-5:]&_=1743232172910","startTime":956.0999999046326,"connectEnd":956.0999999046326,"connectStart":956.0999999046326,"domainLookupEnd":956.0999999046326,"domainLookupStart":956.0999999046326,"fetchStart":956.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1344,"responseEnd":1370.5999999046326,"responseStart":1369.8000001907349,"secureConnectionStart":956.0999999046326},{"duration":347.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/issueNav/latest/preferredSearchLayout","startTime":1028.2000002861023,"connectEnd":1028.2000002861023,"connectStart":1028.2000002861023,"domainLookupEnd":1028.2000002861023,"domainLookupStart":1028.2000002861023,"fetchStart":1028.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1350.4000000953674,"responseEnd":1375.9000000953674,"responseStart":1375.5,"secureConnectionStart":1028.2000002861023},{"duration":304.1000003814697,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/issueNav/1/issueTable/stable","startTime":1078.0999999046326,"connectEnd":1078.0999999046326,"connectStart":1078.0999999046326,"domainLookupEnd":1078.0999999046326,"domainLookupStart":1078.0999999046326,"fetchStart":1078.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1351.9000000953674,"responseEnd":1382.2000002861023,"responseStart":1381.5999999046326,"secureConnectionStart":1078.0999999046326},{"duration":294.1000003814697,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/menu/latest/appswitcher?_=1743232172911","startTime":1085.5999999046326,"connectEnd":1085.5999999046326,"connectStart":1085.5999999046326,"domainLookupEnd":1085.5999999046326,"domainLookupStart":1085.5999999046326,"fetchStart":1085.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1353.9000000953674,"responseEnd":1379.7000002861023,"responseStart":1378.3000001907349,"secureConnectionStart":1085.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":57,"responseStart":202,"responseEnd":218,"domLoading":206,"domInteractive":916,"domContentLoadedEventStart":916,"domContentLoadedEventEnd":1114,"domComplete":1832,"loadEventStart":1832,"loadEventEnd":1834,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[],"measures":[],"correlationId":"79a3a6cf53a17b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":76,"dbConnsTimeInMs":9,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
strictly speaking, whether to reuse or push down should be a cost based decision