I
I
Igor2020-01-13 11:47:19
MySQL
Igor, 2020-01-13 11:47:19

The mysql8 table is added very slowly. What is the reason?

The mysql8 table is added very slowly. What is the reason?

CREATE TABLE `XXXX` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `external_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8

Server with 64G RAM.
config

[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
sql_mode = "ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
max_allowed_packet = 16M
key_buffer_size = 16M
innodb_buffer_pool_size = 32768M
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
max_connections = 6000
slow_query_log = /var/log/mysql/mysql-slow.log
long_query_time = 1
skip-log-bin

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
BasiC2k, 2020-01-13
@BasiC2k

If it's a one-time addition, turn off the indexes and turn them back on after INSERTa. This will help to significantly speed up the addition of data.

V
Vitaly Karasik, 2020-01-13
@vitaly_il1

Really strange, must be very fast.
By the way, slowly is how many in seconds?
Is the server loaded?
Writes something to error.log?

R
Roman Mirilaczvili, 2020-01-14
@2ord

From MySQL table creation insanely slow

SET profiling = 1;
CREATE TABLE blah (id BIGINT UNSIGNED NOT NULL PRIMARY KEY);
SET profiling = 1;

Actually, at the end should be = 0to remove the profiling.
There is a suspicion that there is a problem with the disk.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question