MySQL Forums
Forum List  »  Performance

slow update-join query
Posted by: Neha Kansal
Date: June 07, 2022 12:55PM

Hi,

I have an update-join query which is taking longer than I would expect. The table being updated has 147 million rows and the table its joined with has 135 million rows.

Query looks like this.
update table1 a, table2 t set a.col1 = 1 where a.col2 = t.col2 and a.col3 = t.col3;

I have indexes on col2 and col3 on both the tables. I don't know how long it actually takes, I had to kill it after 9 hours. Is it expected to take this long? Any recommendations on making it faster?

Thanks,
Neha.

Options: ReplyQuote


Subject
Views
Written By
Posted
slow update-join query
754
June 07, 2022 12:55PM
345
June 07, 2022 01:00PM
360
June 07, 2022 01:19PM
400
June 07, 2022 02:27PM
351
June 07, 2022 02:55PM
350
June 07, 2022 03:26PM
334
June 07, 2022 05:06PM
313
June 07, 2022 06:20PM
366
June 08, 2022 09:51AM


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.