Re: Consider low startup cost in add_partial_path

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, James Coleman <jtc331(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Consider low startup cost in add_partial_path
Date: 2026-02-17 07:44:39
Message-ID: CAMbWs4-mO3jMK4t_LgcJ+7Eo=NmGgkxettgRaVbJzZvVZ1koMA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 7, 2026 at 6:06 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> I rediscovered this problem while testing pg_plan_advice, and I think
> we should commit something to fix it.

Yeah, I agree that we should consider startup cost for partial paths,
given that cost_gather (and cost_gather_merge) accounts for the
subpath's startup_cost when calculating the cost of the Gather path.

The changes LGTM. I noticed one comment that may need to be updated
accordingly:

* As in add_path, the partial_pathlist is kept sorted with the cheapest
* total path in front. ...

This is not true anymore. The partial_pathlist is now sorted by
disabled_nodes and then by cheapest total cost.

- Richard

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Akshay Joshi 2026-02-17 07:54:05 Re: [PATCH] pgindent truncates last line of files missing a trailing newline
Previous Message Michael Paquier 2026-02-17 07:26:29 Re: Lowering the default wal_blocksize to 4K