Bug #112084 performance optimization
Submitted: 16 Aug 2023 11:44 Modified: 17 Aug 2023 9:13
Reporter: alex xing (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S5 (Performance)
Version:8.0.34 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[16 Aug 2023 11:44] alex xing
Description:
1. The compiler optimization is obtained by introducing __restrict, which is inspired by clickhouse.
2. clickhouse uses this optimization to achieve a 1.6x performance improvement in the aggregate function scenario, and it is believed that mysql can also have certain performance benefits. And we can get detail information from https://github.com/ClickHouse/ClickHouse/pull/19946/commits/349d783089d55b9dd1bdeb8bff63fd...

How to repeat:
just read the code

Suggested fix:
I made some simple changes based on 8.0.34, so we can test the performance improvement first.And this requires rigorous testing before it goes into production. I haven't done the performance test yet, but I'm sure there will be a performance improvement, and I will do some tests when I have time.
[16 Aug 2023 11:45] alex xing
a simple patch to describe the optimization

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

Contribution: optimize.patch (text/plain), 64.75 KiB.

[16 Aug 2023 11:49] alex xing
https://github.com/mysql/mysql-server/pull/489
[16 Aug 2023 12:08] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
umesh
[16 Aug 2023 12:11] alex xing
May I ask if there is any plan to merge the pr
[17 Aug 2023 1:39] yongliang lee
Affects me
[17 Aug 2023 1:59] alex xing
I missed some changes to the header file, I'll resubmit it later today
[17 Aug 2023 8:52] Roy Lyseng
Posted by developer:
 
I am sorry, but we cannot accept this contribution without proof that it actually improves the performance on a release build server.
[17 Aug 2023 9:13] alex xing
I believe this feature will bring performance improvements, I will report on performance testing later. Please also give me some time, because I have been a little busy recently, and I will start the pressure test when I am finished.