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 Haas <robertmhaas(at)gmail(dot)com>
Cc: Chris <dmagick(at)gmail(dot)com>, Robert James <srobertjames(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Can Postgres use an INDEX over an OR?
Date: 2009-07-27 12:59:17
Message-ID: 331e40660907270559x1530c562pe4b55a681a6639b4@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
27 липня 2009 р. 15:02 Robert Haas <robertmhaas(at)gmail(dot)com> написав:

>
> The problem, though, is that it won't ALWAYS be right to implement OR
> using UNION, so you have to have some way of deciding which is better.
>

That's easy - you propose both ways to planner and it's up to it to decide.
Yes, it can decide wrong way, but we are returning to statistics problem. At
least one can tune costs and enable_ settings. Now one have to rewrite query
that may be not possible/too complex.

In response to

pgsql-performance by date

Next:From: Scott MarloweDate: 2009-07-27 13:39:32
Subject: Re: More speed counting rows
Previous:From: Robert HaasDate: 2009-07-27 12:02:43
Subject: Re: Can Postgres use an INDEX over an OR?

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