cost_agg() with AGG_HASHED does not account for startup costs

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: cost_agg() with AGG_HASHED does not account for startup costs
Date: 2015-08-04 04:55:00
Message-ID: CAKJS1f9ygX3uFd4oHx_ZwrLTnEL1T8dqseHF2F4w9haCkhqJdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
cost_agg_startup_cost.diff text/plain 604 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-08-04 04:56:56 tablecmds.c and lock hierarchy
Previous Message Alvaro Herrera 2015-08-04 04:41:26 Re: max_worker_processes on the standby