mysql update too slow when joining multiple tables
Posted
by user293487
on Stack Overflow
See other posts from Stack Overflow
or by user293487
Published on 2010-04-07T19:07:25Z
Indexed on
2010/04/07
19:13 UTC
Read the original article
Hit count: 202
Hi, I have two tables. they looks like as follows: Id (int) Tags char(128).
the column Tags in table A does not have value. It is empty. The column Tags in table B has value. What I want to copy the Tags in table B to corresponding place of table A. the mapping is based on Id. My sql query is:
update A
INNER JOIN B
set A.Tags = B.Tags
where A.Id = B.Id
There are about 2,000,000 rows in table A, and 50,000 rows in table B. The update seems very slow.... Could anyone tell me how to make it run faster?
© Stack Overflow or respective owner