Re: More efficient OR

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: KeithW(at)narrowpathinc(dot)com
Cc: "PostgreSQL SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: More efficient OR
Date: 2005-02-16 16:21:01
Message-ID: BFC3420B-8036-11D9-B22E-000D933565E8@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Keith Worthington 2005-02-16 16:35:30 Re: More efficient OR
Previous Message Scott Marlowe 2005-02-16 16:15:15 Re: More efficient OR