简体   繁体   中英

Alter Table in MySQL is using only one core

Is there a way to enable all CPU cores for "Alter Table" query? All other queries use 100% cores available, just "Alter Table" uses only one core. Here are some my.cnf settings:

join_buffer_size = 32M
read_buffer_size = 32M
read_rnd_buffer_size = 32M
tmp_table_size = 1G
max_heap_table_size = 1G
#net_buffer_length = 1M
sort_buffer_size = 32M
key_buffer_size = 32M

innodb_buffer_pool_size = 5G
innodb_thread_concurrency = 0
innodb_read_io_threads = 64
innodb_write_io_threads = 64
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 2

We're using MySQL server 5.6.33 on Ubuntu Server 14.04

No you can't use more than one core for an ALTER TABLE , even in MySQL-8.0.

5.7+ has significant improvements to the time of queries that can be done online.

For background ALTER TABLE , use the tools gh-ost or pt-online-schema-change are usable with 5.6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM