Bug #117791 FORCE INDEX does not skip records_in_range() for 'x IS NULL'
Submitted: 25 Mar 2025 13:30 Modified: 23 Mar 1:58
Reporter: Kaiwang CHen (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0, 8.4, 9.2 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

To submit contributions, please log in.

[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.

Attachment: 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.

Attachment: bug_117791_2.patch (application/octet-stream, text), 616 bytes.

[23 Mar 2:00] Kaiwang CHen
Enclosed is the full patch with a common function and the assert solved.

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Attachment: bug_117791_cc.patch (application/octet-stream, text), 8.14 KiB.

[23 Mar 2:03] Kaiwang CHen
Enclosed is a fix for the assert only, using a common function can_use_index_statistics.

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Attachment: bug_117791_assert.patch (application/octet-stream, text), 5.89 KiB.