I have a very complex MySQL query that includes use of the same subquery three times. Will MySQL actually run the subquery three times? (It\'s an expensive one.) If so, is t
For whatever reason, mysql IN clauses with a sub-select run very slow. Better to use join. Your sub-query becomes:
SELECT id from programs P1 INNER JOIN programs P2 ON P1.id = P2.id INNER JOIN playlist_program_map PMAP ON P2.id = PMAP.program_id WHERE P1.submitter_id=32 AND P2.feed_id=2478 AND PMAP.playlist_id=181
It will run much faster.