-- build used (Marcin shared pb2 build link over slack)

cat docs/INFO_SRC
commit: a12c5b82e630721b8ec6fddaf6b79937195c90a5
date: 2023-11-09 16:52:44 +0100
build-date: 2023-11-09 16:08:04 +0000
short: a12c5b82e63
branch: mysql-trunk-build

MySQL source 8.3.0


step 1. start mysqld and use sysbench to prepare a table with size = 60000000.

rm -rf 110722/
bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/110722 --log-error-verbosity=3
bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/110722 --core-file --socket=/tmp/mysql_ushastry.sock  --port=3306 --log-error=$PWD/110722/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3 --secure-file-priv=/tmp/ --innodb-buffer-pool-size=2105745408 --innodb-buffer-pool-instances=2 --innodb-flush-method=O_DIRECT --innodb-read-io-threads=1 --innodb-use-native-aio=off 2>&1 &

 bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.3.0-commercial MySQL Enterprise Server - Commercial

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database sbtest;
Query OK, 1 row affected (0.00 sec)

mysql>


bin/sysbench share/sysbench/oltp_read_write --tables=1 --table_size=60000000 --report-interval=1 --mysql-db=sbtest --mysql-user=root --mysql-socket=/tmp/mysql_ushastry.sock --rand-type=uniform --threads=1 prepare
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Creating table 'sbtest1'...
Inserting 60000000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...


step 2. restart mysqld to empty buffer pool

mysql> shutdown;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye


bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/110722 --core-file --socket=/tmp/mysql_ushastry.sock  --port=3306 --log-error=$PWD/110722/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3  --secure-file-priv=/tmp/ --innodb-buffer-pool-size=2105745408 --innodb-buffer-pool-instances=2 --innodb-flush-method=O_DIRECT --innodb-read-io-threads=1 --innodb-use-native-aio=off 2>&1 &


 bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.3.0-commercial MySQL Enterprise Server - Commercial

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use sbtest
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> set innodb_parallel_read_threads = 16;
Query OK, 0 rows affected (0.00 sec)

mysql> select count(*) from sbtest1;
+----------+
| count(*) |
+----------+
| 60000000 |
+----------+
1 row in set (42.84 sec)

mysql> select count(*) from sbtest1;
+----------+
| count(*) |
+----------+
| 60000000 |
+----------+
1 row in set (40.06 sec)

mysql> shutdown;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye

step 4. restart mysqld with --innodb-use-native-aio=on


bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/110722 --core-file --socket=/tmp/mysql_ushastry.sock  --port=3306 --log-error=$PWD/110722/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3  --secure-file-priv=/tmp/ --innodb-buffer-pool-size=2105745408 --innodb-buffer-pool-instances=2 --innodb-flush-method=O_DIRECT --innodb-read-io-threads=1 --innodb-use-native-aio=on 2>&1 &


step 5. set innodb_parallel_read_threads = 16, execute a select count(*).


bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.3.0-commercial MySQL Enterprise Server - Commercial

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set innodb_parallel_read_threads = 16;
Query OK, 0 rows affected (0.00 sec)

mysql> use sbtest
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select count(*) from sbtest1;
+----------+
| count(*) |
+----------+
| 60000000 |
+----------+
1 row in set (42.16 sec)
mysql> select count(*) from sbtest1;
+----------+
| count(*) |
+----------+
| 60000000 |
+----------+
1 row in set (38.58 sec)


## To sumup - I can confirm that Marcin's patch fixed this issue