Simple-Correlated Performance Issues

In the example query, the simple, noncorrelated subquery traversed the titles table once. The correlated subquery accessed the titles table once for every qualified row in the publisher table, or a total of three times. In most cases, it is more efficient to use simple subqueries. However, if you need to look at the data row by row, a correlated subquery is the answer.

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.