We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using:
CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS
SELECT
H1.`id` AS `historyId`, H1.`uId` AS `uId`, H1.`jobTitleId` AS `jobTitleId`, H1.`joinedDate` AS `joinedDate`,
H1.`eDate` AS `eDate`, H1.`eventId` AS `eventId`, HE.`name` AS `eventName`
FROM (
(`History` H1
LEFTJOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`)
) JOIN (
SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id`
FROM (
(
SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate`
FROM `History`
) SH1
JOIN (
SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate`
FROM (
SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate`
FROM `History`
) TMP
WHERE TMP.`eDate` <= curdate()
GROUPBY TMP.`uId`
) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`)
)
GROUPBY SH1.`uId`
) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`)
Any progress on this issue? Any plans of resolving?
This is a blocker for our application and we're stuck in v10.4.22.
Amil Waduwawara
added a comment - Any progress on this issue? Any plans of resolving?
This is a blocker for our application and we're stuck in v10.4.22.
amilwaduwawara: the output from ANALYZE FORMAT=JSON before the upgrade and after the upgrade would help us a lot in the analysis of the problem.
Igor Babaev (Inactive)
added a comment - amilwaduwawara : the output from ANALYZE FORMAT=JSON before the upgrade and after the upgrade would help us a lot in the analysis of the problem.
Any progress on this issue? Any plans of resolving?
This is a blocker for our application and we're stuck in v10.4.22.
Amil Waduwawara
added a comment - Any progress on this issue? Any plans of resolving?
This is a blocker for our application and we're stuck in v10.4.22.
People
Sergei Petrunia
Amil Waduwawara
Votes:
6Vote for this issue
Watchers:
5Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":895.4000000953674,"ttfb":201.70000004768372,"pageVisibility":"visible","entityId":126359,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"c4ae00d4-0f98-483f-81a0-5e02ce889499","navigationType":0,"readyForUser":981.8000000715256,"redirectCount":0,"resourceLoadedEnd":673.7000000476837,"resourceLoadedStart":207.10000002384186,"resourceTiming":[{"duration":224,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":207.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":431.10000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":224,"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":207.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":431.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":233.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":207.60000002384186,"connectEnd":207.60000002384186,"connectStart":207.60000002384186,"domainLookupEnd":207.60000002384186,"domainLookupStart":207.60000002384186,"fetchStart":207.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":207.60000002384186,"responseEnd":440.7000000476837,"responseStart":440.7000000476837,"secureConnectionStart":207.60000002384186},{"duration":301.2999999523163,"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":207.80000007152557,"connectEnd":207.80000007152557,"connectStart":207.80000007152557,"domainLookupEnd":207.80000007152557,"domainLookupStart":207.80000007152557,"fetchStart":207.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":207.80000007152557,"responseEnd":509.10000002384186,"responseStart":509.10000002384186,"secureConnectionStart":207.80000007152557},{"duration":304.90000009536743,"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":208,"connectEnd":208,"connectStart":208,"domainLookupEnd":208,"domainLookupStart":208,"fetchStart":208,"redirectEnd":0,"redirectStart":0,"requestStart":208,"responseEnd":512.9000000953674,"responseStart":512.9000000953674,"secureConnectionStart":208},{"duration":305.10000002384186,"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":208.20000004768372,"connectEnd":208.20000004768372,"connectStart":208.20000004768372,"domainLookupEnd":208.20000004768372,"domainLookupStart":208.20000004768372,"fetchStart":208.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":208.20000004768372,"responseEnd":513.3000000715256,"responseStart":513.3000000715256,"secureConnectionStart":208.20000004768372},{"duration":305.2999999523163,"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":208.30000007152557,"connectEnd":208.30000007152557,"connectStart":208.30000007152557,"domainLookupEnd":208.30000007152557,"domainLookupStart":208.30000007152557,"fetchStart":208.30000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":208.30000007152557,"responseEnd":513.6000000238419,"responseStart":513.6000000238419,"secureConnectionStart":208.30000007152557},{"duration":373.89999997615814,"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":208.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":582.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":305.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":208.60000002384186,"connectEnd":208.60000002384186,"connectStart":208.60000002384186,"domainLookupEnd":208.60000002384186,"domainLookupStart":208.60000002384186,"fetchStart":208.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":208.60000002384186,"responseEnd":514.1000000238419,"responseStart":514.1000000238419,"secureConnectionStart":208.60000002384186},{"duration":373.7999999523163,"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":208.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":582.5,"responseStart":0,"secureConnectionStart":0},{"duration":306,"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":208.80000007152557,"connectEnd":208.80000007152557,"connectStart":208.80000007152557,"domainLookupEnd":208.80000007152557,"domainLookupStart":208.80000007152557,"fetchStart":208.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":208.80000007152557,"responseEnd":514.8000000715256,"responseStart":514.8000000715256,"secureConnectionStart":208.80000007152557},{"duration":434.2000000476837,"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":209.70000004768372,"connectEnd":209.70000004768372,"connectStart":209.70000004768372,"domainLookupEnd":209.70000004768372,"domainLookupStart":209.70000004768372,"fetchStart":209.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":209.70000004768372,"responseEnd":643.9000000953674,"responseStart":643.9000000953674,"secureConnectionStart":209.70000004768372},{"duration":459.7999999523163,"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":213.90000009536743,"connectEnd":213.90000009536743,"connectStart":213.90000009536743,"domainLookupEnd":213.90000009536743,"domainLookupStart":213.90000009536743,"fetchStart":213.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":213.90000009536743,"responseEnd":673.7000000476837,"responseStart":673.6000000238419,"secureConnectionStart":213.90000009536743},{"duration":61.700000047683716,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":609.6000000238419,"connectEnd":609.6000000238419,"connectStart":609.6000000238419,"domainLookupEnd":609.6000000238419,"domainLookupStart":609.6000000238419,"fetchStart":609.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":609.6000000238419,"responseEnd":671.3000000715256,"responseStart":671.3000000715256,"secureConnectionStart":609.6000000238419}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":44,"responseStart":201,"responseEnd":206,"domLoading":205,"domInteractive":1044,"domContentLoadedEventStart":1044,"domContentLoadedEventEnd":1093,"domComplete":1346,"loadEventStart":1346,"loadEventEnd":1347,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1021.8000000715256},{"name":"bigPipe.sidebar-id.end","time":1022.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1022.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1024.2000000476837},{"name":"activityTabFullyLoaded","time":1113.1000000238419}],"measures":[],"correlationId":"f758050fc31adf","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":93,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
igor, note that there's GROUP BY tmp.id2