Re: SQL performance - optimizer question

From: Michael P. Stein <mstein_at_access2.digex.net>
Date: 31 Jan 1994 10:31:00 -0500
Message-ID: <2ij87k$nmt_at_access2.digex.net>


Kevin Neel <k-neel_at_nwu.edu> wrote:
> I.e. I suspect that it may dynamically
>recognize that no record can succeed (e.g. select 'x' from table1 where
>1=2 is always fast; is it true if they are bind variables?) and decide to
>do nothing.

    Not true for Oracle. The optimizer (at least through 7.0.12) does not recognize degenerate WHERE clauses; WHERE 1=2 causes a full table scan. Try it with a million row table and see how fast it isn't, or do an EXPLAIN PLAN.

-- 
Mike Stein			The above represents the Absolute Truth.
POB 10420			Therefore it cannot possibly be the official
Arlington, VA  22210		position of my employer.
Received on Mon Jan 31 1994 - 16:31:00 CET

Original text of this message