Can I somehow force mysql to do a full scan on the subquery result instead of the existing table?
Let’s say I’ve got a query:
DELETE FROM table_a WHERE id IN (SELECT id FROM table_b WHERE ...)
If I’m sure that the subquery returns ~10 results, while table_a has thousands, can I somehow force table_a records to be looked up, and table_b result to be scanned? Mysql insists (according to EXPLAIN SELECT * FROM table_a...) to do ALL on table_a and index lookup on table_b.
Instead you can add index on field
idand tryINNER JOIN: