Re: set_cheapest without checking pathlist - Mailing list pgsql-hackers

From Richard Guo
Subject Re: set_cheapest without checking pathlist
Date
Msg-id CAMbWs4-=eCZMxw6Th4e86qmSVj+3z+3O7iuAyORBJN3qt-GhMA@mail.gmail.com
Whole thread Raw
In response to set_cheapest without checking pathlist  (James Coleman <jtc331@gmail.com>)
Responses Re: set_cheapest without checking pathlist
List pgsql-hackers

On Thu, Feb 1, 2024 at 10:04 AM James Coleman <jtc331@gmail.com> wrote:
I don't see any inherent reason why we must always assume that
gather_grouping_paths will always result in having at least one entry
in pathlist. If, for example, we've disabled incremental sort and the
cheapest partial path happens to already be sorted, then I don't
believe we'll add any paths. And if that happens then set_cheapest
will error with the message "could not devise a query plan for the
given query". So I propose we add a similar guard to this call point.

I don't believe that would happen.  It seems to me that we should, at
the very least, have a path which is Gather on top of the cheapest
partial path (see generate_gather_paths), as long as the
partially_grouped_rel has partial paths.

Thanks
Richard

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: speed up a logical replica setup
Next
From: David Rowley
Date:
Subject: Re: set_cheapest without checking pathlist