we are trying to get some statistics on our large log tables in MySQL. Some select queries take too long to complete and throw exceptions like:Raised: java.sql.SQLException: lock timeout was exceeded; try restarting the transaction.This leads to the fact that our application stops working with the same error. After some research, we decided to change the "innodb_lock_wait_timeout" variable of our MySQL server configuration.
But what are the disadvantages of this configuration?
. . , linux mytop , EXPLAIN, , . / , .
mytop
, MariaDB (fork of MySQL) , , .
, , - , . , CREATE TABLE AS SELECT * FROM table_x..., , -, table_x InooDB.
CREATE TABLE AS SELECT * FROM table_x...
innodb_locks_unsafe_for_binlog true ( my.cnf innodb_locks_unsafe_for_binlog=1). InnoDB.
innodb_locks_unsafe_for_binlog
innodb_locks_unsafe_for_binlog=1
. .