Search Postgresql Archives

Re: Improving the timing of a query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> wrote:
On Fri, Dec 07, 2007 at 12:07:52PM -0500, mgainty@xxxxxxxxxxx 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@xxxxxxxxx>   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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux