Bug #100182 Improving performance of 'row_mysql_store_col_in_innobase_format'
Submitted: 10 Jul 2020 13:35 Modified: 10 Jul 2020 15:49
Reporter: Dmitriy Philimonov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0.20 OS:Any
Assigned to: CPU Architecture:ARM
Tags: strings, utf8

[10 Jul 2020 13:35] Dmitriy Philimonov
Description:
Continuing the research made in https://bugs.mysql.com/bug.php?id=99694,
we found another opportunity to slightly increase performance of InnoDB.

`storage/innobase/row/row_mysql_store_col_in_innobase_format` function 
chops spaces inefficiently, we already have the `skip_space_skipping`
function in include/m_string.h which does it faster. It makes sense for
fixed fields with UTF8 charset (see comments in the source).

Since the function is not too hot, to prove the profit we used sysbench
OLTP_UPDATE_NON_INDEX test and managed to see +2.5% improvement in 4 threads.

Our platform: Kunpeng 920 aarch64 CPU (64 cores), Ubuntu 20.04, gcc-9.3.0

How to repeat:
Code analysis, positive effects in https://bugs.mysql.com/bug.php?id=99694

Suggested fix:
Use skip_trailing_spaces in the row_mysql_store_col_in_innobase_format function
when dealing with 0x20 spaces.
[10 Jul 2020 14:31] MySQL Verification Team
Hi Mr. Philimonov,

Thank you for your performance improvement report.

I have studied your contribution and I think that you are correct.

Verified as reported.
[10 Jul 2020 15:49] Dmitriy Philimonov
Typo: `skip_space_skipping` -> `skip_trailing_space`
[13 Jul 2020 12:40] MySQL Verification Team
Thank you, Mr. Philimonov.