Re: oracle/sql "where clause"

From: John Verhoeven <johnv_at_acix.DIALix.oz.au>
Date: 1996/09/28
Message-ID: <johnv.0a4n_at_acix.DIALix.oz.au>#1/1


In article dated Thu, 26 Sep 1996 06:23:00 +0100, AMARENDRA B NETTEM (nettama_at_charlie.cns.iit.edu) wrote:
> Paul Chow wrote:
> > does anyone know whether one of the following two where clauses is more efficient
> > than the other ...
> >
> > [1]. select ...
> > from ...
> > where (field_x='K' or field_x='L' or field_x='M')
> >
> > [2]. select ...
> > from ...
> > where field_x in ('K','L','M')
 

> Second query is efficient than the first one. But make there are no NULL
> value for that field when using IN operator.

Nope. Neither is more efficient than the other.

The second may be quicker for you to write, but the parser converts it into the first form for execution anyway.

Do an explain plan on both queries and you will see that they are treated the same.

--
 _--_|\  John Verhoeven           Unix / Database Administrator Westrail
/      \              johnv_at_DIALix.oz.au / jverhoeven_at_westrail.wa.gov.au
*_.--._/
      v   "Smile! things could be worse... So I did... and they were..."
Received on Sat Sep 28 1996 - 00:00:00 CEST

Original text of this message