Re: SQL Humor

From: Paul <paul_at_test.com>
Date: Fri, 19 Aug 2005 11:20:31 +0100
Message-ID: <4305b683$0$1290$ed2619ec_at_ptn-nntp-reader02.plus.net>


Mike Hodgson wrote:
> The EXISTS() predicate is typically a fairly efficient predicate because
> it only needs to scan until it gets a match, at which time it returns.
> The worst case scenario (it finds a match on the last physical row, or
> it doesn't find any matching row) is the same I/O as the IN() predicate
> case because IN() will evaluate the entire subquery.

Why does IN() need to evaluate the entire subquery? Couldn't it in theory work exactly the same as EXISTS() at the physical level?

Paul. Received on Fri Aug 19 2005 - 12:20:31 CEST

Original text of this message