I am running a simple INSERT INTO ... SELECT ... ON DUPLICATE KEY UPDATE ... query using either DataGrip or DBeaver or PHP and it always doesnt register the result.
The SELECT inside takes about 10 minutes and the query always completes (the table is updated) but the program / PHP process doesnt get the result and just waits.
Using SHOW FULL PROCESSLIST I can see the query being executed and after 10 minutes it transforms into "command: sleep" and just hangs there.
My MySQL version is 5.7.33-0ubuntu0.16.04.1 hosted on AWS EC2 and some relevant variables from SHOW VARIABLES:
Variable_name Value
connect_timeout 3600
delayed_insert_timeout 300
have_statement_timeout YES
innodb_flush_log_at_timeout 1
innodb_lock_wait_timeout 100
innodb_rollback_on_timeout OFF
interactive_timeout 1800
lock_wait_timeout 31536000
net_read_timeout 3600
net_write_timeout 3600
rpl_stop_slave_timeout 31536000
slave_net_timeout 60
wait_timeout 28800
Any ideas what to change? Any missing configuration to be updated? Thank you
SELECT
? ProvideEXPLAIN
andSHOW CREATE TABLE
.