Decided to upgrade older 10.3.13 with the currently latest version 10.5.6.
One of my sql selects started throwing SQL Error (1038): Out of sort memory.
Versions are running on the same machine (sharing the same port, so just one instance is running at a time). Did mysqldump to have identical conditions. Using default settings (attached system variables for both versions).
Need to set sort_buffer_size to ~120MB to make script working again while older one works well with default 2MB.
I managed to simlify the script while still keeping an error (I understand it does not makes sense now, its really a shortened version so I could share something with you):
DROP TABLE IF EXISTS test_products;
|
CREATE TABLE test_products (
|
product_name VARCHAR(7),
|
id_country INT,
|
PRIMARY KEY (product_name, id_country)
|
) COLLATE='utf8_general_ci' ENGINE=INNODB;
|
|
DELIMITER //
|
FOR i IN 1..3700 DO INSERT INTO test_products (product_name, id_country) VALUES ('product', i); END FOR; //
|
DELIMITER ;
|
|
SELECT p.product_name, p.id_country, hierarchy.hierarchy
|
FROM test_products p
|
LEFT JOIN (
|
SELECT p2.product_name, p2.id_country, h.hierarchy, MAX(test) AS test
|
FROM test_products p2
|
LEFT JOIN (
|
SELECT product_name, id_country, '_exactly_' AS hierarchy, 1 AS test -- removing one single character from string '_exactly_' will stop producing error
|
FROM test_products
|
) h ON h.product_name = p2.product_name AND h.id_country = p2.id_country
|
GROUP BY product_name, id_country, h.hierarchy
|
) hierarchy ON hierarchy.product_name = p.product_name AND hierarchy.id_country = p.id_country
|
Is this behaviour correct?
Is increasing sort_buffer_size a recommended way to make the script working again?
Thank you
{"report":{"fcp":1831.6999998092651,"ttfb":753.5,"pageVisibility":"visible","entityId":93038,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"9ffab407-5ef6-4980-bbae-ef615a1adaba","navigationType":0,"readyForUser":1953.5,"redirectCount":0,"resourceLoadedEnd":2210.5999999046326,"resourceLoadedStart":758.5999999046326,"resourceTiming":[{"duration":371.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":758.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":758.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1130.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":371.69999980926514,"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":758.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":758.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1130.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":415.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":759.0999999046326,"connectEnd":759.0999999046326,"connectStart":759.0999999046326,"domainLookupEnd":759.0999999046326,"domainLookupStart":759.0999999046326,"fetchStart":759.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":759.0999999046326,"responseEnd":1174.5,"responseStart":1174.5,"secureConnectionStart":759.0999999046326},{"duration":707.5999999046326,"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":759.1999998092651,"connectEnd":759.1999998092651,"connectStart":759.1999998092651,"domainLookupEnd":759.1999998092651,"domainLookupStart":759.1999998092651,"fetchStart":759.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":759.1999998092651,"responseEnd":1466.7999997138977,"responseStart":1466.7999997138977,"secureConnectionStart":759.1999998092651},{"duration":725.0999999046326,"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":759.4000000953674,"connectEnd":759.4000000953674,"connectStart":759.4000000953674,"domainLookupEnd":759.4000000953674,"domainLookupStart":759.4000000953674,"fetchStart":759.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":759.4000000953674,"responseEnd":1484.5,"responseStart":1484.5,"secureConnectionStart":759.4000000953674},{"duration":725.4000000953674,"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":759.5999999046326,"connectEnd":759.5999999046326,"connectStart":759.5999999046326,"domainLookupEnd":759.5999999046326,"domainLookupStart":759.5999999046326,"fetchStart":759.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":759.5999999046326,"responseEnd":1485,"responseStart":1485,"secureConnectionStart":759.5999999046326},{"duration":725.7000002861023,"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":759.6999998092651,"connectEnd":759.6999998092651,"connectStart":759.6999998092651,"domainLookupEnd":759.6999998092651,"domainLookupStart":759.6999998092651,"fetchStart":759.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":759.6999998092651,"responseEnd":1485.4000000953674,"responseStart":1485.4000000953674,"secureConnectionStart":759.6999998092651},{"duration":726,"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":760,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":760,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1486,"responseStart":0,"secureConnectionStart":0},{"duration":725.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":760.1999998092651,"connectEnd":760.1999998092651,"connectStart":760.1999998092651,"domainLookupEnd":760.1999998092651,"domainLookupStart":760.1999998092651,"fetchStart":760.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":760.1999998092651,"responseEnd":1485.7999997138977,"responseStart":1485.7999997138977,"secureConnectionStart":760.1999998092651},{"duration":726.4000000953674,"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":760.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":760.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1486.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":726.1999998092651,"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":760.4000000953674,"connectEnd":760.4000000953674,"connectStart":760.4000000953674,"domainLookupEnd":760.4000000953674,"domainLookupStart":760.4000000953674,"fetchStart":760.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":760.4000000953674,"responseEnd":1486.5999999046326,"responseStart":1486.5999999046326,"secureConnectionStart":760.4000000953674},{"duration":1338.5,"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":770.2999997138977,"connectEnd":770.2999997138977,"connectStart":770.2999997138977,"domainLookupEnd":770.2999997138977,"domainLookupStart":770.2999997138977,"fetchStart":770.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":770.2999997138977,"responseEnd":2108.7999997138977,"responseStart":2108.7999997138977,"secureConnectionStart":770.2999997138977},{"duration":1440.1999998092651,"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":770.4000000953674,"connectEnd":770.4000000953674,"connectStart":770.4000000953674,"domainLookupEnd":770.4000000953674,"domainLookupStart":770.4000000953674,"fetchStart":770.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":770.4000000953674,"responseEnd":2210.5999999046326,"responseStart":2210.5999999046326,"secureConnectionStart":770.4000000953674},{"duration":679,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1419.5,"connectEnd":1419.5,"connectStart":1419.5,"domainLookupEnd":1419.5,"domainLookupStart":1419.5,"fetchStart":1419.5,"redirectEnd":0,"redirectStart":0,"requestStart":1419.5,"responseEnd":2098.5,"responseStart":2098.5,"secureConnectionStart":1419.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":593,"responseStart":754,"responseEnd":766,"domLoading":757,"domInteractive":2250,"domContentLoadedEventStart":2250,"domContentLoadedEventEnd":2329,"domComplete":3533,"loadEventStart":3533,"loadEventEnd":3535,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2223.9000000953674},{"name":"bigPipe.sidebar-id.end","time":2224.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":2225},{"name":"bigPipe.activity-panel-pipe-id.end","time":2227.199999809265},{"name":"activityTabFullyLoaded","time":2343.4000000953674}],"measures":[],"correlationId":"7b2613c23f178e","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":9,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}