efficiency of group by 1 order by 1

Поиск
Список
Период
Сортировка
От TJ O'Donnell
Тема efficiency of group by 1 order by 1
Дата
Msg-id 441AC937.5020105@acm.org
обсуждение исходный текст
Ответы Re: efficiency of group by 1 order by 1
Список pgsql-general
 >> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Emi Lu
Дата:
Сообщение: Re: About index for temporay table in a plpgsql function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Slow trigger on identical DB but different machine