Re: Problem with index in OR'd expression - Mailing list pgsql-general

From Ragnar
Subject Re: Problem with index in OR'd expression
Date
Msg-id 1167687210.6369.403.camel@localhost.localdomain
Whole thread Raw
In response to Re: Problem with index in OR'd expression  (postgresql.org@tgice.com)
List pgsql-general
On mán, 2007-01-01 at 14:21 -0600, postgresql.org@tgice.com wrote:

> Within the context of the function (after calling), these variables are
> constant and I'm attempting to use my OR syntax as shorthand to avoid
> having to use a dynamic statement *only* because of this situation.
> As I've mentioned, this approach seems to work with MSSQL 6.5+, which I
> assume we consider as a valid competitor to PG... if this didn't work
> anywhere else, I probably wouldn't even have brought it up.
>
> I'll re-iterate another question I attempted to pose which was: what
> have other PG application developers done in this situation?  Is it most
> common to just use dynamic statements?

ps/pgsql will prepare the statement caching the plan for
subsequent calls, thus making this not easily optimized.

to avoid this in ps/pgsql , I believe it is common to to make
the statement dynamic by using EXECUTE, thus in effect making
sure the query is planned each time.

gnari



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Installing support for python on windows
Next
From: "Ken Winter"
Date:
Subject: How to convert "money" columns to "numeric"?