Re: More efficient OR - Mailing list pgsql-sql

From Reinoud van Leeuwen
Subject Re: More efficient OR
Date
Msg-id 20050216161508.GW4705@spoetnik.xs4all.nl
Whole thread Raw
In response to More efficient OR  ("Keith Worthington" <keithw@narrowpathinc.com>)
List pgsql-sql
On Wed, Feb 16, 2005 at 11:02:59AM -0500, Keith Worthington wrote:
> Hi All,
> 
> In several of my SQL statements I have to use a WHERE clause that contains
> mutiple ORs.  i.e.
> 
> WHERE column1 = 'A' OR
>       column1 = 'B' OR
>       column1 = 'C'
> 
> Is there a more efficient SQL statement that accomplishes the same limiting
> functionality?

I do not know wheter it is more efficient in terms of execution, but I can
read this more efficiently:

WHERE column1 in ('A', 'B', 'C')


-- 
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen    reinoud.v@n.leeuwen.net
http://www.xs4all.nl/~reinoud
__________________________________________________


pgsql-sql by date:

Previous
From: "Keith Worthington"
Date:
Subject: More efficient OR
Next
From: Scott Marlowe
Date:
Subject: Re: More efficient OR