Bug #115499 InnoDB: key buffer sort could be skipped when pk order preserved
Submitted: 3 Jul 2024 11:30 Modified: 3 Jul 2024 12:28
Reporter: Shaohua Wang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.38, 8.0.40 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[3 Jul 2024 11:30] Shaohua Wang
Description:
In innobase_pk_order_preserved(), we check if pk order is preserved.

In Builder::bulk_add_row(), we still call key_buffer_sort() when is_skip_file_sort() is true. Actaully we don't need the key sort in memory.

How to repeat:
code inspection.

Suggested fix:
Just skip the key buffer sort.
[3 Jul 2024 11:32] Shaohua Wang
Contributed patch

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

Contribution: skip_key_buffer_sort.patch (application/octet-stream, text), 1.44 KiB.

[3 Jul 2024 12:28] MySQL Verification Team
Hello Shaohua,

Thank you for the report and contribution.

regards,
Umesh
[26 Dec 2024 6:40] MySQL Verification Team
Bug #117043 marked as duplicate of this one