cost_agg() with AGG_HASHED does not account for startup costs - Mailing list pgsql-hackers

From David Rowley
Subject cost_agg() with AGG_HASHED does not account for startup costs
Date
Msg-id CAKJS1f9ygX3uFd4oHx_ZwrLTnEL1T8dqseHF2F4w9haCkhqJdQ@mail.gmail.com
Whole thread Raw
Responses Re: cost_agg() with AGG_HASHED does not account for startup costs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
During working on allowing the planner to perform GROUP BY before joining I've noticed that cost_agg() completely ignores input_startup_cost when aggstrategy == AGG_HASHED.

I can see at least 3 call to cost_agg() which pass aggstrategy as AGG_HASHED that are also passing a possible non-zero startup cost.

The attached changes cost_agg() to include the startup cost, but does nothing for the changed plans in the regression tests.

Is this really intended?

Regards

David Rowley

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
Attachment

pgsql-hackers by date:

Previous
From: Takashi Horikawa
Date:
Subject: Re: patch: prevent user from setting wal_buffers over 2GB bytes
Next
From: Michael Paquier
Date:
Subject: tablecmds.c and lock hierarchy