Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group