Bug #114154 | Parallel read is slow after parition table is read in parallel | ||
---|---|---|---|
Submitted: | 28 Feb 9:57 | Modified: | 14 Jun 14:18 |
Reporter: | Ke Yu (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S5 (Performance) |
Version: | 8.0.36 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[28 Feb 9:57]
Ke Yu
[28 Feb 11:08]
MySQL Verification Team
Hello Ke Yu, Thank you for the report and test case. I'm not seeing such huge diff i.e. 2.89s and 2.582s vs 24.81 and 23.89 sec but 2-3 X between first time and later one(13sec vs 27sec). I'm starting instance with default settings. Could you please attach configuration file from your instance if it is not on default? Thank you. Anyway, verifying for now. regards, Umesh
[28 Feb 12:59]
Ke Yu
The config is --innodb-buffer-pool-size=6442450944 --innodb-flush-method=O_DIRECT --innodb-use-native-aio=on, all other parameters retain their default values. I think the cpu\disk io performance may affect the result. Can you share the time cost you execute 'select count(*) from sbtest1' before and after step 5 ? The main point I want to make is that in this case parallel read will not be able to get threads, that is, it will invalid.
[28 Feb 13:07]
MySQL Verification Team
Thank you for the details. Before and after the 5th step in my environment: -- mysql> set innodb_parallel_read_threads = 32; Query OK, 0 rows affected (0.00 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (13.97 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (13.53 sec) -- mysql> set innodb_parallel_read_threads = 32; Query OK, 0 rows affected (0.00 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (26.99 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (27.49 sec)
[28 Feb 14:32]
Ke Yu
Hi, MySQL Verification Team Thank you for the details. I suspect that your and my different results are due to disk performance.
[29 Feb 9:50]
MySQL Verification Team
Hello Ke Yu, Agree, before and after 5th steps: mysql> set innodb_parallel_read_threads = 32; Query OK, 0 rows affected (0.00 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (1.37 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (1.80 sec) mysql> set innodb_parallel_read_threads = 32; Query OK, 0 rows affected (0.00 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (16.32 sec) mysql> select count(*) from sbtest1; +----------+ | count(*) | +----------+ | 40000000 | +----------+ 1 row in set (16.55 sec) regards, Umesh
[2 Apr 3:12]
Ke Yu
This is my fix code, based on 8.0.36. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug114154.diff (application/octet-stream, text), 8.46 KiB.
[14 Jun 14:18]
Philip Olson
Posted by developer: Fixed as of the upcoming MySQL Server 8.0.38, 8.4.1, and 9.0.0 releases, and here's the proposed changelog entry from the documentation team: --- If a partition table was read with innodb_parallel_read_threads=1, read performance greatly decreased from any table after 256 reads. InnoDB behaved as if it reached the maximum capacity of parallel read threads despite not using any. Our thanks to Ke Yu for the contribution. --- Thank you for the bug report.