Re: Sorting an aggregated column

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Sorting an aggregated column
Дата
Msg-id 20189.1080053642@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Sorting an aggregated column  ("David Witham" <davidw@unidial.com.au>)
Список pgsql-sql
"David Witham" <davidw@unidial.com.au> writes:
> So I see that there is the extra sort above the sub-query that
> wouldn't be there using 7.4. Are you saying that the sort by survey
> after the sort by survey,question would potentially reorder the
> records initially sorted by survey,question?

Exactly.  Most implementations of qsort() aren't "stable", which means
they might reorder equal keys in some random way.  So to preserve the
sub-ordering on question, you need the upper sort to be skipped.  The
7.4 planner is smart enough to notice it doesn't need the upper sort,
prior releases were not.
        regards, tom lane


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

Предыдущее
От: Erik Thiele
Дата:
Сообщение: fine grained trigger time specification...
Следующее
От: Erik Thiele
Дата:
Сообщение: Re: fine grained trigger time specification...