[MDEV-23142] Improving performance of 'row_mysql_store_col_in_innobase_format' Created: 2020-07-10  Updated: 2022-01-27

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5.3
Fix Version/s: 10.6

Type: Bug Priority: Minor
Reporter: Dmitriy Philimonov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-22720 Improving performance of my_hash_sort... Stalled

 Description   

Continuing the research made in MDEV-22720,
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_trailing_space`
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

Suggested fix
Use skip_trailing_spaces in the row_mysql_store_col_in_innobase_format function
when dealing with 0x20 spaces:

col_len = skip_trailing_space(ptr + n_chars, col_len - n_chars) - ptr;


Generated at Thu Feb 08 09:20:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.