Re: Consider low startup cost in add_partial_path - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Consider low startup cost in add_partial_path
Date
Msg-id CAMbWs496OtWPR4G3yzdQgxeWKb7rZydVnGBdX-2UrfA_o7GWhQ@mail.gmail.com
Whole thread Raw
In response to Re: Consider low startup cost in add_partial_path  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Consider low startup cost in add_partial_path
List pgsql-hackers
On Fri, Feb 20, 2026 at 4:30 AM Robert Haas <robertmhaas@gmail.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



pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Skipping schema changes in publication
Next
From: Ashutosh Bapat
Date:
Subject: Re: SQL Property Graph Queries (SQL/PGQ)