Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: performance of OR versus IN

Re: performance of OR versus IN

From: <ctcgag_at_hotmail.com>
Date: 19 May 2003 23:31:38 GMT
Message-ID: <20030519193138.177$vS@newsreader.com>


dfult_at_econs.umass.edu (Doug) wrote:
>
> select count(p.personOID)
> from Address a, AddressXPerson axp, Person p
> where a.postalCode in
> ('07010','07020','07022','07024','07030','07032','07047')
> AND axp.addressOID = a.addressOID
> AND axp.role = 'Practitioner'
> AND p.personOID = axp.personOID;

> select count(p.personOID)
> from Address a, AddressXPerson axp, Person p
> where a.postalCode = '07010'
> OR postalCode = '07020'
> OR postalCode = '07022'
> OR postalCode = '07024'
> OR postalCode = '07030'
> OR postalCode = '07032'
> OR postalCode = '07047'
> AND axp.addressOID = a.addressOID
> AND axp.role = 'Practitioner'
> AND p.personOID = axp.personOID;

I have nothing to say about the performance of these two queries, but I will say they are not logical equivalent. In the latter, all the non-postal requirements are bound to just zip 07047, not the 5 other zips.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB
Received on Mon May 19 2003 - 18:31:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US