The first request will effectively cross-connect before the upgrade, which is terrible performance.
The second query will run this subquery for each row in the external table, which is very poor performance.
Nothing is especially good ... just the thing is worse. :)
Do you want to update the entire items table?
Have you tried searching for @ EXPLAIN equivalent SELECT two queries?
EXPLAIN SELECT items.brand_id, brands.id FROM items, brands WHERE brands.name = 'apple'
and
EXPLAIN SELECT brand_id, id FROM items, (SELECT id FROM brands WHERE name = 'apple') a
Even better, run UPDATE / equivilent SELECTS and do a few SHOW STATUS LIKE 'handler_%' to see how many lines are being read / written.
source share