Search Postgresql Archives

efficiency of group by 1 order by 1

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

 



>> Is there a way to eliminate the ugly repeated use of
>> date_trunc('day',endtime)?


>>In this particular case you could say
>>
>>	... GROUP BY 1 ORDER BY 1;

I use a similar SQL, e.g.:
 select func(x)....group by func(x) order by func(x)
but my func is rather expensive.  Is func(x) evaluated three times
in the above statement?  Would it be evaluated only once if I used
 select func(x)....group by 1 order by 1

TJ O'Donnell
www.gnova.com


[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