I am carrying out the below query and it has said "Loading" for ages now. I can look at my other table within the database but when I try to look at the one I was querying it just says "Loading" , would this kind of query take long. I have about 59k records in that test_db table and 10k in the other. I am using waamp server 3.0.6 on windows 10
UPDATE test_db t
JOIN whisky w ON t.name=w.whisky_name
SET t.whisky_id = w.whisky_id;
To speed this query:
UPDATE test_db t JOIN
whisky w
ON t.name = w.whisky_name
SET t.whisky_id = w.whisky_id;
You want an index. The optimal index is whisky(whisky_name, whisky_id)
. It is very important that whisky_name
be the first key in the index.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.