Bug #119094 Performance optimization patches
Submitted: 29 Sep 13:03 Modified: 29 Sep 13:13
Reporter: Kamil Holubicki (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[29 Sep 13:03] Kamil Holubicki
Description:
Based on work published on https://github.com/enhancedformysql/mysql-8.0.40 by Bin Wang, Percona identified several fixes that we applied to Percona Server and hope can be incorporated in MySQL. All patches attached.

1. mem_root_deque implementation using std::list
2. Inlining hot-spot InnoDB functions
3. Revert refactoring that extracted rec_init_offset_new() function. (8.0.29, commit e8f422de).
We have found that even if a new function is declared as 'inline', the compiler doesn't decide to do so. Moreover, the introduced switch/case introduces an additional conditional jump in the generated assembly code.
4. Fix for refactoring done in commit 43e364c3 (const tables handling by optimizer).
If the optimizer detected the const table in the query, this information is not passed to test_quick_select() and may result in nonoptimal range scan boundaries.

How to repeat:
.
[29 Sep 13:04] Kamil Holubicki
const tables patch

Attachment: const_tables.patch (text/x-patch), 2.75 KiB.

[29 Sep 13:04] Kamil Holubicki
rec_init_offset_new patch

Attachment: rec_init_offset_new.patch (text/x-patch), 7.26 KiB.

[29 Sep 13:05] Kamil Holubicki
const tables patch

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

Contribution: const_tables.patch (text/x-patch), 2.75 KiB.

[29 Sep 13:05] Kamil Holubicki
rec_init_offset_new patch

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

Contribution: rec_init_offset_new.patch (text/x-patch), 7.26 KiB.

[29 Sep 13:05] Kamil Holubicki
inline patch

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

Contribution: inline.patch (text/x-patch), 21.68 KiB.

[29 Sep 13:13] Kamil Holubicki
I'm not able to add a patch for deque part. When submitting, I see the server error.
I will retry again later. 

Commits are available here:
https://github.com/percona/percona-server/commit/a45db1eb1aaa7486879cf4c360dfd5f70f445ff2
https://github.com/percona/percona-server/commit/bc0ec11d952a32afd9e2d6cdb4b6333fd9484114