On Sun, Mar 5, 2017 at 11:32 PM, Ashutosh Bapat <ashutosh.ba...@enterprisedb.com> wrote: >> I think there have been >> previous discussions of switching over to the practice for which you >> are advocating here, but my impression (without researching) is that >> the current practice is more like what Rushabh did. > > I am not sure Rushabh's approach is correct. Here's the excerpt from my mail. > >>> The reason the reason why startup_cost = input_startup_cost and not >>> input_total_cost for aggregation by sorting is we don't need the whole >>> input before the Group/Agg plan can produce the first row. > > With Rushabh's approach the startup cost of aggregation by sorting > would be way higher that it's right now. Secondly, it would match that > of hash aggregation and thus forcing hash aggregation to be chosen in > almost all the cases.
You're right. I'm wrong. I take it all back. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers