| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера