Looking into it for a related SR of mine. I need to be sure it is a config issue not a regression bug. I could about repeat the reporter's phenomenon, using a server running with only built-in default configuration. Baseline: [anon@fc30 mysql-commercial-8.0.19-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.19-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 50331648 @@innodb_buffer_pool_size: 134217728 real 4m30.259s <<<<<<<<<<<<< user 0m0.011s sys 0m0.004s --------------- [anon@fc30 mysql-commercial-8.0.20-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.20-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 50331648 @@innodb_buffer_pool_size: 134217728 real 7m29.738s <<<<<<<<<<<<< user 0m0.005s sys 0m0.009s ---------- [anon@fc30 mysql-commercial-8.0.21-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.21-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 50331648 @@innodb_buffer_pool_size: 134217728 real 7m7.460s <<<<<<<<<<<<< user 0m0.004s sys 0m0.008s --------------- I didn't investigate the root cause of above slowdown. Instead I focused on speeding up 8.0.21: Then I bumped up the innodb buffer pool and reran test once: [anon@fc30 mysql-commercial-8.0.21-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.21-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 50331648 @@innodb_buffer_pool_size: 4294967296 real 4m58.965s user 0m0.009s sys 0m0.005s Somewhat better ;) ---------------------- Since 48M redo logs aren't used in real life, I bumped those up too, and reran once more: [anon@fc30 mysql-commercial-8.0.21-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.21-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 1073741824 @@innodb_buffer_pool_size: 4294967296 real 3m27.643s user 0m0.007s sys 0m0.005s Getting better.... -------------------------- 8.0.21 has a new option to disable REDO, I next ran ALTER INSTANCE DISABLE INNODB REDO_LOG; before importing, and reran : [anon@fc30 mysql-commercial-8.0.21-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.21-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 1073741824 @@innodb_buffer_pool_size: 4294967296 real 2m56.532s user 0m0.006s sys 0m0.007s -------------------------- Next, I decided to disable innodb_doublewrite and retest (with redo disabled too) - totally unsafe!: [anon@fc30 mysql-commercial-8.0.21-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.21-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 1073741824 @@innodb_buffer_pool_size: 4294967296 real 2m58.812s user 0m0.008s sys 0m0.006s Alright, doublewrite has no impact here. ------------- finally, I decided to retest 8.0.19 with the new configuration (except cannot turn off redo): [anon@fc30 mysql-commercial-8.0.19-linux-glibc2.12-x86_64]$ time ./bin/mysql -uroot test < /home/anon/tmp/g.sql *************************** 1. row *************************** @@version: 8.0.19-commercial @@innodb_flush_log_at_trx_commit: 1 @@log_bin: 1 @@sync_binlog: 1 @@internal_tmp_mem_storage_engine: TempTable @@innodb_io_capacity: 200 @@innodb_io_capacity_max: 2000 @@innodb_log_buffer_size: 16777216 @@innodb_log_file_size: 1073741824 @@innodb_buffer_pool_size: 4294967296 real 3m32.424s user 0m0.006s sys 0m0.008s this is comparable to the above 8.0.21 test yielding 3m27.643s ------ g.sql contained this: drop table if exists test; CREATE TABLE `test` ( `Key1` int NOT NULL AUTO_INCREMENT, `Key2` date NOT NULL, `Key3` varchar(20) NOT NULL, `Value` float DEFAULT NULL, PRIMARY KEY (`Key1`,`Key2`,`Key3`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; INSERT INTO `test` (`Key2`, `Key3`, `Value`) VALUES ('2000-01-01', 'key3', '1.1'); INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; INSERT INTO `test` (`Key2`, `Key3`, `Value`) select Key2, Key3, Value FROM test; drop table if exists test; select @@version,@@innodb_flush_log_at_trx_commit,@@log_bin,@@sync_binlog,@@internal_tmp_mem_storage_engine,@@innodb_io_capacity,@@innodb_io_capacity_max,@@innodb_log_buffer_size,@@innodb_log_file_size,@@innodb_buffer_pool_size\G