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":6716.400000095367,"ttfb":895.3000001907349,"pageVisibility":"visible","entityId":93038,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0,"journeyId":"cd27e836-c3d8-4371-a1a8-8bab108353e5","navigationType":0,"readyForUser":5295.10000038147,"redirectCount":0,"resourceLoadedEnd":4866.700000286102,"resourceLoadedStart":956.9000000953674,"resourceTiming":[{"duration":729.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":956.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":956.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1686.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":729.2999997138977,"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":957.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":957.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1686.5,"responseStart":0,"secureConnectionStart":0},{"duration":3078.300000190735,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":957.4000000953674,"connectEnd":957.4000000953674,"connectStart":957.4000000953674,"domainLookupEnd":957.4000000953674,"domainLookupStart":957.4000000953674,"fetchStart":957.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1694.7000002861023,"responseEnd":4035.7000002861023,"responseStart":2185.300000190735,"secureConnectionStart":957.4000000953674},{"duration":3451.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":957.6000003814697,"connectEnd":957.6000003814697,"connectStart":957.6000003814697,"domainLookupEnd":957.6000003814697,"domainLookupStart":957.6000003814697,"fetchStart":957.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":1694.8000001907349,"responseEnd":4409.200000286102,"responseStart":2182.4000000953674,"secureConnectionStart":957.6000003814697},{"duration":1425.6999998092651,"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":957.7000002861023,"connectEnd":957.7000002861023,"connectStart":957.7000002861023,"domainLookupEnd":957.7000002861023,"domainLookupStart":957.7000002861023,"fetchStart":957.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1694.9000000953674,"responseEnd":2383.4000000953674,"responseStart":2279.2000002861023,"secureConnectionStart":957.7000002861023},{"duration":1576.8000001907349,"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":957.9000000953674,"connectEnd":957.9000000953674,"connectStart":957.9000000953674,"domainLookupEnd":957.9000000953674,"domainLookupStart":957.9000000953674,"fetchStart":957.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1695.1000003814697,"responseEnd":2534.7000002861023,"responseStart":2373.2000002861023,"secureConnectionStart":957.9000000953674},{"duration":1425.6000003814697,"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":958,"connectEnd":958,"connectStart":958,"domainLookupEnd":958,"domainLookupStart":958,"fetchStart":958,"redirectEnd":0,"redirectStart":0,"requestStart":1695.2000002861023,"responseEnd":2383.6000003814697,"responseStart":2336.6000003814697,"secureConnectionStart":958},{"duration":740.5999999046326,"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":958.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":958.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1698.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":1576.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":958.4000000953674,"connectEnd":958.4000000953674,"connectStart":958.4000000953674,"domainLookupEnd":958.4000000953674,"domainLookupStart":958.4000000953674,"fetchStart":958.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1695.2000002861023,"responseEnd":2535.1000003814697,"responseStart":2383.800000190735,"secureConnectionStart":958.4000000953674},{"duration":740.3999996185303,"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":958.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":958.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1699,"responseStart":0,"secureConnectionStart":0},{"duration":1776.4000000953674,"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":958.8000001907349,"connectEnd":958.8000001907349,"connectStart":958.8000001907349,"domainLookupEnd":958.8000001907349,"domainLookupStart":958.8000001907349,"fetchStart":958.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1695.4000000953674,"responseEnd":2735.2000002861023,"responseStart":2528.6000003814697,"secureConnectionStart":958.8000001907349},{"duration":3906.199999809265,"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":959.6000003814697,"connectEnd":959.6000003814697,"connectStart":959.6000003814697,"domainLookupEnd":959.6000003814697,"domainLookupStart":959.6000003814697,"fetchStart":959.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":2185,"responseEnd":4865.800000190735,"responseStart":4413.900000095367,"secureConnectionStart":959.6000003814697},{"duration":3907,"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":959.7000002861023,"connectEnd":959.7000002861023,"connectStart":959.7000002861023,"domainLookupEnd":959.7000002861023,"domainLookupStart":959.7000002861023,"fetchStart":959.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":2536.5,"responseEnd":4866.700000286102,"responseStart":4598.60000038147,"secureConnectionStart":959.7000002861023},{"duration":843.4000000953674,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":4247,"connectEnd":4247,"connectStart":4247,"domainLookupEnd":4247,"domainLookupStart":4247,"fetchStart":4247,"redirectEnd":0,"redirectStart":0,"requestStart":4867.400000095367,"responseEnd":5090.400000095367,"responseStart":4902.200000286102,"secureConnectionStart":4247}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":523,"responseStart":895,"responseEnd":898,"domLoading":903,"domInteractive":5818,"domContentLoadedEventStart":5818,"domContentLoadedEventEnd":5874,"domComplete":7443,"loadEventStart":7443,"loadEventEnd":7443,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":5557.700000286102},{"name":"bigPipe.sidebar-id.end","time":5558.700000286102},{"name":"bigPipe.activity-panel-pipe-id.start","time":5559},{"name":"bigPipe.activity-panel-pipe-id.end","time":5561},{"name":"activityTabFullyLoaded","time":5888.800000190735}],"measures":[],"correlationId":"efe6119ee4e888","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":14,"dbConnsTimeInMs":24,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The patch is present in the branch 10.5-varun