Reputation: 15
I want to optimize the execution time (50 sec) of the following update command.
UPDATE matches a
JOIN players AS b
ON a.player1_name = b.player_name
SET a.player1_id = b.id
WHERE a.player1_id = 0
The table matches has approximately 10000 entries and table players 4000 entries.
Upvotes: 1
Views: 133
Reputation: 1169
Make sure you have indexes on a.player1_name, b.player_name and a.player1_id.
Upvotes: 1