Re: group by not returning sorted rows
От
Tom Lane
Тема
Re: group by not returning sorted rows
Дата
Msg-id
16211.1081204461@sss.pgh.pa.us
Ответ на
group by not returning sorted rows (Bret Hughes)
Список
Дерево обсуждения
group by not returning sorted rows Bret Hughes <bhughes@elevating.com>
Re: group by not returning sorted rows Tom Lane <tgl@sss.pgh.pa.us>
Re: group by not returning sorted rows Bret Hughes <bhughes@elevating.com>
Re: group by not returning sorted rows Stephan Szabo <sszabo@megazone.bigpanda.com>
Bret Hughes writes: > and the rows resulting from the query are no longer sorted by log date. > Is this a change since 7.2x? Yes. 7.4 can use hashing instead of sorting to bring grouped rows together. > I can achieve the results I need by adding an order by clause identical > to the group by but this seems counter intuitive since the rows have to > be ordered anyway. No they don't; you're making an assumption about the implementation that is no longer warranted. The SQL spec doesn't require it either ... output ordering is only guaranteed if you specify ORDER BY, per spec. regards, tom lane
В списке pgsql-sql по дате отправления