| От | Tom Lane |
|---|---|
| Тема | Re: EquivalenceClasses vs volatile functions |
| Дата | |
| Msg-id | 7931.1194413399@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: EquivalenceClasses vs volatile functions (Gregory Stark <stark@enterprisedb.com>) |
| Список | pgsql-hackers |
Gregory Stark <stark@enterprisedb.com> writes:
> What if the equivalence class is in more than one place in the ORDER BY?
That's not a problem. ORDER BY 1,1 is not different from ORDER BY 1,
even if the referenced expression is volatile, because the secondary
sort key is useless anyway.
> And what would happen when you pull up subqueries?
I think I know how to deal with that. The worst case would be that
select * from (select random() as a from foo order by a) ssorder by ss.a
would incur two sorts instead of one because we fail to acknowledge the
subquery's sort key as being the same thing as the upper query's. It
*should* be possible to avoid that, but if it gets too complicated I'll
leave it on the table for 8.4.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера