Re: Improving the timing of a query - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Improving the timing of a query
Date
Msg-id 20071207174441.GE2878@svana.org
Whole thread Raw
In response to Re: Improving the timing of a query  (mgainty@hotmail.com)
Responses Re: Improving the timing of a query
List pgsql-general
On Fri, Dec 07, 2007 at 12:07:52PM -0500, mgainty@hotmail.com wrote:
> other DB's do FTS when there is a function involved in the predicate (WHERE
> clause)
> so a possible workaround would be to look at all function calls in your
> predicate (WHERE clause) and
> populate a new column with the results of the function(column)
> and then create and populate an index which will reference the
> function(column)

You don't need to create a column, yu can create functional indexes in
postgres:

CREATE INDEX foo ON bar ((myfunction(column)));

And it can be used anytime your query says: WHERE myfunction(column) = X

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment

pgsql-general by date:

Previous
From: Howard Cole
Date:
Subject: Killing a session in windows
Next
From: Bob Pawley
Date:
Subject: pg_dump