Bug #119285 resue read-view for read_only mode
Submitted: 1 Nov 2025 6:16 Modified: 29 Jan 6:39
Reporter: alex xing (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0.44 OS:Any
Assigned to: CPU Architecture:Any

[1 Nov 2025 6:16] alex xing
Description:
The logic for Read View reuse in the Read Committed (RC) isolation level could be relaxed by lifting the restriction on trx_is_autocommit_non_locking transactions.

This change would significantly reduce contention by avoiding the repeated acquisition of the trx_sys->mutex for creating new Read Views in high-concurrency read workloads.

How to repeat:
just read the code

Suggested fix:
just as the below patch
[1 Nov 2025 6:17] 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: rc_read_review_reuse_optimize.patch (application/octet-stream, text), 1.57 KiB.

[1 Nov 2025 6:25] alex xing
I implemented an optimization on MySQL 8.0.43 which resulted in a performance increase of up to 5% in the Sysbench read-only scenario

Sysbench 1.0.20
MySQL bufferpool : 32G
8.0.43

---------------------small data---------------------
sysbench /root/sysbench-1.0.20/share/sysbench/oltp_read_only.lua --db-driver=mysql --mysql-user=sbtest --mysql-password=sbtest --mysql-host=127.0.0.1 --mysql-port=4000 --mysql-db=sbtest --tables=128 --table-size=25000 --sum-ranges=0 --rand-type=uniform --report-interval=10 --threads=256 --percentile=99 --time=300 --events=0 --skip-trx=off --mysql-ignore-errors=all run

threads   old_tps  new_tps  new_tps/old_tps
32       16992.74  17420.06  1.02514721
64       18933.36  19571     1.033678122
128      17791.84  18417.67  1.035175114
256      16210.3   16883.89  1.04155321

---------------------big data---------------------
sysbench-1.0.20/share/sysbench/oltp_read_only.lua --db-driver=mysql --mysql-user=sbtest --mysql-password=sbtest --mysql-host=127.0.0.1 --mysql-port=4000 --mysql-db=sbtest --tables=256 --table-size=800000 --sum-ranges=0 --rand-type=uniform --report-interval=10 --threads=256 --percentile=99 --time=300 --events=0 --skip-trx=off --mysql-ignore-errors=all run

threads  old_tps   new_tps   new_tps/old_tps
32       10897.48  10940.94  1.003988078
64       13302.33  13615.45  1.023538733
128      13181.45  13466.55  1.02162888
256      12674.37  12925.39  1.019805324
[29 Jan 6:39] alex xing
Has there been any progress here?