Re: Improving the timing of a query

From: "Matthew Pulis" <mpulis(at)gmail(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, mgainty(at)hotmail(dot)com, "Matthew Pulis" <mpulis(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Improving the timing of a query
Date: 2007-12-07 17:55:38
Message-ID: f88da7150712070955r62c92e48m73d4d3edeba0b284@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> wrote:
>
> On Fri, Dec 07, 2007 at 12:07:52PM -0500, mgainty(at)hotmail(dot)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(at)svana(dot)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[(at)]hotmail(dot)com
ICQ : 145951110
Skype : solutions-lab.net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2007-12-07 17:58:46 Re: pg_dump
Previous Message Robert Treat 2007-12-07 17:53:45 Re: Re-partitioning huge schema