Search Postgresql Archives

Avoiding evaluating functions twice.

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

 



Hello,

I've got the following situation:

select expensive_function(table) from table 
                     where expensive_function(table) is not null;

Is there a way to avoid that expensive_function is evaluated twice (if it's 
not null) ? 
I've tried stuff like immutable, but that doesn't do anything for me.
Of course I can do a select into, but my guess is it would be even more 
expensive than evaluating these functions twice.

Thanks in advance,

Han Holl



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[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