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-25 06:35:05
Message-ID: CAMbWs496OtWPR4G3yzdQgxeWKb7rZydVnGBdX-2UrfA_o7GWhQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 20, 2026 at 4:30 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Thanks. I have committed 0001 after adjusting that comment.
>
> Here's the remaining patch once again. No comments on this one?

(Sorry I somehow lost track of this thread.)

I noticed that in this patch, add_partial_path_precheck duplicates the
entire logic of compare_path_costs_fuzzily. I wonder if it would be
better to avoid this code duplication.

I'm thinking that maybe we could extract the core math of
compare_path_costs_fuzzily into an internal helper function that
operates on cost values (and disabled_nodes) rather than on Path
structures. We could then call this helper directly from within
add_partial_path_precheck.

That said, I'm not quite sure if that refactoring is worth the churn,
or if there is a better way to do that.

Otherwise, the patch looks good to me.

- Richard

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-02-25 06:40:55 Re: SQL Property Graph Queries (SQL/PGQ)
Previous Message Zhijie Hou (Fujitsu) 2026-02-25 06:33:10 RE: Skipping schema changes in publication