| Bug #120574 | Range optimizer exceeds memory limit and chooses bad range plan for large IN lists | ||
|---|---|---|---|
| Submitted: | 29 May 14:05 | Modified: | 4 Aug 13:50 |
| Reporter: | Qingping Zhu | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 8.0.41 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | Memory, Optimizer, performance, range_optimizer_max_mem_size, range-optimizer | ||
[29 May 14:05]
Qingping Zhu
[29 May 14:10]
Qingping Zhu
Self-contained reduced repro script.
Attachment: single_sql_range_mem_repro.sql (application/octet-stream, text), 2.77 KiB.
[29 May 14:12]
Qingping Zhu
Prototype patch for this issue
Attachment: 0001-range-optimizer-mem-guard-v1.patch (application/octet-stream, text), 3.13 KiB.
[4 Aug 13:50]
Chaithra Marsur Gopala Reddy
Hi Qingping Zhu, Thank you for the test case. We have verified the issue. We think this is duplicate of an old report Bug#100595. As you have observed, range_optimizer_max_mem_size limit does not apply in this case. This is because that setting limits memory used during range analysis. The large memory allocation in this case occurs later, when the selected range access is materialized into execution-time QUICK_RANGE objects; that allocation is not controlled by this setting. It is the same underlying issue as that of Bug#100595. We are therefore marking this report as a duplicate. The required fix is to restrict the execution-time range representation and fall back to another applicable access path when that limit is reached. We see that you have contributed a patch to handle this. Thank you very much, we appreciate it! In order for us to continue the process of reviewing your contribution to MySQL, please send us a signed copy of the Oracle Contributor Agreement (OCA) as outlined in https://oca.opensource.oracle.com Signing an OCA needs to be done only once and it's valid for all other Oracle governed Open Source projects as well. Getting a signed/approved OCA on file will help us facilitate your contribution - this one, and others in the future. Please let me know, if you have any questions. Thank you for your interest in MySQL. --Chaithra
