Re: AGG_PLAIN thinks sorts are free
От | Tom Lane |
---|---|
Тема | Re: AGG_PLAIN thinks sorts are free |
Дата | |
Msg-id | 10280.1374255382@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: AGG_PLAIN thinks sorts are free (Jeff Janes <jeff.janes@gmail.com>) |
Список | pgsql-hackers |
Jeff Janes <jeff.janes@gmail.com> writes: > On Thu, Jul 18, 2013 at 8:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> DISTINCT (and also ORDER BY) properties of aggregates are implemented >> at runtime; the planner doesn't really do anything about them, except >> suppress the choice it might otherwise make of using hashed aggregation. > Couldn't a hash aggregate be superior to a sort one (for the distinct, > not the order by)? If it worked at all, it might be superior, but since it doesn't, it ain't. This isn't really a matter of lack of round tuits, but a deliberate judgment that it's probably not worth the trouble. Per the comment in choose_hashed_grouping: /* * Executor doesn't support hashed aggregation with DISTINCT or ORDER BY * aggregates. (Doing so would implystoring *all* the input values in * the hash table, and/or running many sorts in parallel, either of which * seemslike a certain loser.) */ regards, tom lane
В списке pgsql-hackers по дате отправления: