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

From Matthew Pulis
Subject Re: Improving the timing of a query
Date
Msg-id f88da7150712070955r62c92e48m73d4d3edeba0b284@mail.gmail.com
Whole thread Raw
In response to Re: Improving the timing of a query  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Thanks for your suggestions :)

Even though the ideas are good, the function is working really fast now, 1.5-2seconds which is quite enough I guess :)

This is how the function is at the moment : http://yancho.pastebin.com/d236fd97f

Sorry I forgot to update this thread :(

On 12/7/07, Martijn van Oosterhout < kleptog@svana.org> wrote:
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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFHWYaJIB7bNG8LQkwRAmOyAJ92ZtXFiQfme/Rn2+2ylISrR3YM+ACfTWO8
ftUieOQhrQCQy+rBAElRr68=
=ALYk
-----END PGP SIGNATURE-----




--
Matthew Pulis
URL : http://www.solutions-lab.net
MSN : pulis_matthew[@]hotmail.com
ICQ : 145951110
Skype : solutions-lab.net

pgsql-general by date:

Previous
From: "A. Ozen Akyurek"
Date:
Subject: copy a large table raises out of memory exception
Next
From: "jzhang2004@sbcglobal.net"
Date:
Subject: VTD-XML Tutorial by Code Examples Posted Options