Re: More efficient OR - Mailing list pgsql-sql

From Sean Davis
Subject Re: More efficient OR
Date
Msg-id BFC3420B-8036-11D9-B22E-000D933565E8@mail.nih.gov
Whole thread Raw
In response to More efficient OR  ("Keith Worthington" <keithw@narrowpathinc.com>)
Responses Re: More efficient OR  ("Keith Worthington" <keithw@narrowpathinc.com>)
List pgsql-sql
Could 'in' or 'between' do what you want?  I know that using 'in' is 
equivalent to what you have below.  Could 'between' be more 
efficient--you could do explain analyze on various options to see what 
the actual plan would be.

Sean

On Feb 16, 2005, at 11:02 AM, 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?
>
> Kind Regards,
> Keith
>
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings



pgsql-sql by date:

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