Re: Do AGGREGATES consistently use sort order?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Do AGGREGATES consistently use sort order?
Дата
Msg-id 5661.1189120355@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Do AGGREGATES consistently use sort order?  (Chris Browne <cbbrowne@acm.org>)
Список pgsql-general
Chris Browne <cbbrowne@acm.org> writes:
> stark@enterprisedb.com (Gregory Stark) writes:
>> In theory we can't promise anything about future versions of
>> Postgres but there are lots of people doing this already so if ever
>> this was lost there would probably be some new explicit way to
>> achieve the same thing.

> Is there not some risk that the query planner might choose to do
> hash-based accumulation could discard the subquery's ordering?

Hash aggregation doesn't change the order in which input rows are fed to
any one aggregate; it only results in nominally-independent aggregate
functions being computed in parallel.  If you tried to write an
aggregate function that had hidden private state and wasn't re-entrant,
it would likely fail under hash aggregation; but aggregate functions
that "play by the rules" by keeping all their state in the declared
state object will work fine.

The long and the short of it is that we are very well aware that people
depend on this behavior, and we are not likely to break it.

            regards, tom lane

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

Предыдущее
От: brian
Дата:
Сообщение: log_statement and PREPARE
Следующее
От: Chris Browne
Дата:
Сообщение: Re: an other provokative question??