Search Postgresql Archives

Re: Static functions

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

 



Tom Lane wrote:
"Gurjeet Singh" <singh.gurjeet@xxxxxxxxx> writes:
Shouldn't PG make all efforts to not execute something when the result is
already known?

Not if said effort would cost more than is saved, which would be by far
the most likely result if we tried to cache all function results.

			regards, tom lane

In this case, with the function being called over and over again inside a nested loop, it would be worth the effort. I'm not even talking about caching the result for the whole transaction block, just replacing the function call before continuing the query.

Perhaps I can get around this problem by creating a temp table inside the function that is dropped on transaction commit.


[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