MySQL Forums
Forum List  »  Newbie

MySQL Update query time-out
Posted by: Gideon Engelbrecht
Date: October 05, 2020 08:13AM

I have the following MySql query to update a single table :

update EzyComposition
set TonPerBlok = (select * from (select sum(equivton) from EzyComposition t2
where EzyComposition.vessel = t2.vessel AND
EzyComposition.grower = t2.grower AND
EzyComposition.block = t2.block AND
EzyComposition.section = t2.section )tblTemp);


It takes forever to execute eventually giving me an error: Error Code: 2013. Lost connection to MySQL server during query

I have tried to set the preferences/SQL Editor all the DBMS's to 5000

Also I used :

SET innodb_lock_wait_timeout = 5000;

before the rest of the update statemen, but I get the same error.
I have 126,029 rows in the database. I understand to update a table from itself a subquery and temporary table is necessary.

Can anyone please help me?

Regards

Options: ReplyQuote


Subject
Written By
Posted
MySQL Update query time-out
October 05, 2020 08:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.