One of the customer reported that running a huge query (25KB) having a NOT-IN clause with many values running forever, causing the server to use available free memory and invoking the oom-killer to kill the mysqld process. Same behavior when tried to get the `EXPLAIN PLAN`.
Initially, checking the existing bugs, found following two:
MDEV-9764 - MariaDB does not limit memory used for range optimization
MDEV-9750 - extended_keys=on causing the memory exhaustion on queries having multiple IN/NOT IN using INNODB
As per those two bugs, we have told customer to turn off the "extended_keys" and check, but it's not helping out.
Further, locally on the MariaDB Server versions 10.2.21, 10.3.14 and 10.4.12(ES), I can reproduce the same behavior on an empty table. Here as well, neither setting "extended_keys=off" helped nor the "max_session_mem_used" system variable worked to avoid the exhaustion of available free memory.
Repro steps, I will share it separately.
Maybe, we need to understand how can we handle this case?
Thank You.
causes
MDEV-24444
ASAN use-after-poison in Item_func_in::get_func_mm_tree with NOT IN query
Closed
includes
MDEV-24711
Make "unique_key NOT IN (...)" conditions non-sargable
Closed
relates to
MDEV-26856
Queries with many NOT IN clauses or ORs use a lot of memory
Open
MDEV-9750
Quick memory exhaustion with 'extended_keys=on' on queries having multiple 'IN'/'NOT IN' using InnoDB
Closed
MDEV-23634
Select query hanged the server and leads to OOM in MariaDB 10.4.14
Closed
mentioned in
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Show 25 more links (25 mentioned in)
{"report":{"fcp":1235.3999996185303,"ttfb":309.19999980926514,"pageVisibility":"visible","entityId":84166,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"e593ca7d-7464-41f8-afe6-6fdf5feee73b","navigationType":0,"readyForUser":1331.8000001907349,"redirectCount":0,"resourceLoadedEnd":944.5,"resourceLoadedStart":333.5,"resourceTiming":[{"duration":77.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":333.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":333.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":410.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":77.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":333.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":333.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":411,"responseStart":0,"secureConnectionStart":0},{"duration":435.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":334,"connectEnd":334,"connectStart":334,"domainLookupEnd":334,"domainLookupStart":334,"fetchStart":334,"redirectEnd":0,"redirectStart":0,"requestStart":420,"responseEnd":769.0999994277954,"responseStart":440.5,"secureConnectionStart":334},{"duration":610.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":334.0999994277954,"connectEnd":334.0999994277954,"connectStart":334.0999994277954,"domainLookupEnd":334.0999994277954,"domainLookupStart":334.0999994277954,"fetchStart":334.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":419.3999996185303,"responseEnd":944.5,"responseStart":457.69999980926514,"secureConnectionStart":334.0999994277954},{"duration":108.10000038146973,"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":334.3999996185303,"connectEnd":334.3999996185303,"connectStart":334.3999996185303,"domainLookupEnd":334.3999996185303,"domainLookupStart":334.3999996185303,"fetchStart":334.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":420.30000019073486,"responseEnd":442.5,"responseStart":441.30000019073486,"secureConnectionStart":334.3999996185303},{"duration":111.30000019073486,"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":334.5999994277954,"connectEnd":334.5999994277954,"connectStart":334.5999994277954,"domainLookupEnd":334.5999994277954,"domainLookupStart":334.5999994277954,"fetchStart":334.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":422.5999994277954,"responseEnd":445.8999996185303,"responseStart":445.19999980926514,"secureConnectionStart":334.5999994277954},{"duration":115.60000038146973,"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":334.69999980926514,"connectEnd":334.69999980926514,"connectStart":334.69999980926514,"domainLookupEnd":334.69999980926514,"domainLookupStart":334.69999980926514,"fetchStart":334.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":423.30000019073486,"responseEnd":450.30000019073486,"responseStart":446,"secureConnectionStart":334.69999980926514},{"duration":87.60000038146973,"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":334.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":334.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":422.5,"responseStart":0,"secureConnectionStart":0},{"duration":115.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":335,"connectEnd":335,"connectStart":335,"domainLookupEnd":335,"domainLookupStart":335,"fetchStart":335,"redirectEnd":0,"redirectStart":0,"requestStart":424.69999980926514,"responseEnd":450.3999996185303,"responseStart":446.69999980926514,"secureConnectionStart":335},{"duration":89.5,"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":335.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":335.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":424.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":123.19999980926514,"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":335.30000019073486,"connectEnd":335.30000019073486,"connectStart":335.30000019073486,"domainLookupEnd":335.30000019073486,"domainLookupStart":335.30000019073486,"fetchStart":335.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":426.69999980926514,"responseEnd":458.5,"responseStart":447.5,"secureConnectionStart":335.30000019073486},{"duration":541.1999998092651,"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":337.30000019073486,"connectEnd":337.30000019073486,"connectStart":337.30000019073486,"domainLookupEnd":337.30000019073486,"domainLookupStart":337.30000019073486,"fetchStart":337.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":560.0999994277954,"responseEnd":878.5,"responseStart":867.8999996185303,"secureConnectionStart":337.30000019073486},{"duration":542.3999996185303,"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":337.30000019073486,"connectEnd":337.30000019073486,"connectStart":337.30000019073486,"domainLookupEnd":337.30000019073486,"domainLookupStart":337.30000019073486,"fetchStart":337.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":627.8000001907349,"responseEnd":879.6999998092651,"responseStart":873.5,"secureConnectionStart":337.30000019073486},{"duration":142.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":907.8999996185303,"connectEnd":907.8999996185303,"connectStart":907.8999996185303,"domainLookupEnd":907.8999996185303,"domainLookupStart":907.8999996185303,"fetchStart":907.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1017.8000001907349,"responseEnd":1050.1999998092651,"responseStart":1049.3999996185303,"secureConnectionStart":907.8999996185303},{"duration":161.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1185.5,"connectEnd":1185.5,"connectStart":1185.5,"domainLookupEnd":1185.5,"domainLookupStart":1185.5,"fetchStart":1185.5,"redirectEnd":0,"redirectStart":0,"requestStart":1316.5,"responseEnd":1347.1999998092651,"responseStart":1346.5999994277954,"secureConnectionStart":1185.5},{"duration":239.9000005722046,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1226.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1226.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1466.8000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":84,"responseStart":309,"responseEnd":324,"domLoading":327,"domInteractive":1486,"domContentLoadedEventStart":1486,"domContentLoadedEventEnd":1565,"domComplete":1896,"loadEventStart":1896,"loadEventEnd":1897,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1428.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1429},{"name":"bigPipe.activity-panel-pipe-id.start","time":1429.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.end","time":1431.1999998092651},{"name":"activityTabFullyLoaded","time":1581.3999996185303}],"measures":[],"correlationId":"8ec0b5c0dd0d88","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":150,"dbReadsTimeInMs":15,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Pushed the "conservative" fix.