Re: Planning without reason.

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Planning without reason.
Date: 2006-06-23 13:14:47
Message-ID: 20060623131447.GD8900@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 23, 2006 at 03:57:19PM +0300, Tzahi Fadida wrote:
> R contains indices but not on all attributes or not on
> all ordered subset of keys.
>
> Query example:
> (SELECT * FROM R
> WHERE a=3, b=6,. ...)
> UNION
> (SELECT * FROM R
> WHERE b=5, d=2,. ...)
> UNION
> ....
> And lots of unions.

Do you need UNION, or do you actually mean UNION ALL?

Also, couldn't you just do:

SELECT * FROM R
WHERE (a=3, b=6, ...)
OR (b=5, d=2, ...)
etc

> I am currently just writing the query as a string and open a cursor.
> Is there a simple way to use Datums instead of converting the attributes to
> strings to create a plan for SPI.
> 10x.

I imagine SPI_prepare() and SPI_execp() would be used for this.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-06-23 13:23:58 Re: Overhead for stats_command_string et al, take 2
Previous Message Mark Woodward 2006-06-23 13:00:32 Re: vacuum, performance, and MVCC