Correlated Subqueries are Evil and Slow. Or are They?

A common myth in SQL is the idea that correlated subqueries are evil and slow. For example, this query here: SELECT first_name, last_name, (SELECT count(*) FROM film_actor fa WHERE fa.actor_id = a.actor_id) FROM actor a It "forces" the database engine to run a nested loop of the form (in pseudo code): for (Actor a : … Continue reading Correlated Subqueries are Evil and Slow. Or are They?