I have a query:
UPDATE table_1 set field_1 = 1 where field_2 IN
(SELECT field_2 from table_2 where field_3 = 1)
However this takes a LONG time with a large database (>2000ms). Is there anway to re-write this query using JOINs to get away from using IN?
NOTE: There are indexes on field_1, and field_3 however it doesn’t help the query. This is using MySQL.
1 Answer