Sub-queries: a faster alternative to NOT EXISTS
Abstract
Avoiding sub-queries can be essential to reduce long run-times on large data sets. However, it is sometimes necessary to identify rows in one table for which there is no associated row in another table. An example would be an order for which there are no order detail lines. The conventional approach is to use theNOT EXISTS (sub-query), but this can be extremely slow for large data sets. This article demonstrates how an ANSI join can achieve the same result much more efficiently, even on large data sets.
[Read More…]
