| Bug #117791 | FORCE INDEX does not skip records_in_range() for 'x IS NULL' | ||
|---|---|---|---|
| Submitted: | 25 Mar 2025 13:30 | Modified: | 16 Mar 8:19 |
| Reporter: | Kaiwang CHen (OCA) | Email Updates: | |
| Status: | Need Feedback | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
| Version: | 8.0, 8.4, 9.2 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | Contribution | ||
[25 Mar 2025 13:30]
Kaiwang CHen
[25 Mar 2025 13:33]
Kaiwang CHen
Add more checks in the range iterator so that SKIP_RECORDS_IN_RANGE itself precisely decides the alternative estimation. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug_117791.patch (application/octet-stream, text), 5.62 KiB.
[25 Mar 2025 13:46]
Kaiwang CHen
The second path adds null test for index statistics inside the alternative estimation branch, which makes force index nicer. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug_117791_2.patch (application/octet-stream, text), 616 bytes.
[25 Mar 2025 13:47]
MySQL Verification Team
Hello Kaiwang, Thank you for the report and contribution. regards, Umesh
[16 Mar 8:19]
Øystein Grøvlen
Hi Kaiwang, Thank you for the contribution. We would like to apply your contribution. However, it seems there is an issue with other storage engines than InnoDB. Tests like perfschema.table_component and main.myisam hits an assert in handler::multi_range_read_info_const(). This needs to be resolved before we can take the contribution.
