Re: Can Postgres use an INDEX over an OR?

From: Віталій Тимчишин <tivv00(at)gmail(dot)com>
To: Robert James <srobertjames(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Can Postgres use an INDEX over an OR?
Date: 2009-07-20 06:18:43
Message-ID: 331e40660907192318t607eb913p520f531f3d65037e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2009/7/20 Robert James <srobertjames(at)gmail(dot)com>

>
> Hi. I notice that when I do a WHERE x, Postgres uses an index, and when I
> do WHERE y, it does so as well, but when I do WHERE x OR y, it doesn't. Why
> is this so?

It's not clever enough.

And how can I shut this off?

Use UNION/UNION ALL if possible in your case.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Chris 2009-07-20 08:02:12 Re: Can Postgres use an INDEX over an OR?
Previous Message Peter Eisentraut 2009-07-20 06:02:34 Re: Fastest char datatype