Search Postgresql Archives

Re: Optimize expresiions.

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

 



On Thursday 11 January 2007 15:03, Adam Rich wrote:
> How about this?
>
> select item, very_expensive_function(item) as exp, cheap
> from ( Select item, cheap_function(item) as cheap
> 	From atable where cheap_function(item) > 0 ) sub
> where very_expensive_function(item) > 0
>
>
Well, there is nothing wrong with the much simpler
 where cheap_function(item) > 0 and  where very_expensive_function(item) > 0.

It's all about the order of evaluation.

Thanks,

Han Holl


[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