Re: Can we rely on the ordering of paths in pathlist?

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Can we rely on the ordering of paths in pathlist?
Date: 2026-02-04 09:52:38
Message-ID: 202602040952.6vlirlski6od@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-Apr-11, Richard Guo wrote:

> As the comment above add_path() says, 'The pathlist is kept sorted by
> total_cost, with cheaper paths at the front.' And it seems that
> get_cheapest_parallel_safe_total_inner() relies on this ordering
> (without being mentioned in the comments, which I think we should do).
> I'm wondering if this is the right thing to do, as in other places
> cheapest total cost is found by compare_path_costs(), which would
> consider startup cost if paths have the same total cost, and that seems
> more sensible.
>
> Attach a trivial patch to make get_cheapest_parallel_safe_total_inner
> act this way.

Hello Richard, did you make you mind on whether you wanted to complete
this?
https://commitfest.postgresql.org/patch/4285/

Thanks

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-02-04 09:57:33 Re: Retiring is_pushed_down
Previous Message Álvaro Herrera 2026-02-04 09:49:13 Re: On non-Windows, hard depend on uselocale(3)