Re: set_cheapest without checking pathlist

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: James Coleman <jtc331(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: set_cheapest without checking pathlist
Date: 2024-02-01 03:37:29
Message-ID: CAApHDvrF2LStybjHzxjPHbEAphgqRGcPiBOq1wLvC_5POUNysg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 1 Feb 2024 at 16:29, Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
>
>
> On Thu, Feb 1, 2024 at 10:04 AM James Coleman <jtc331(at)gmail(dot)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.

It will have partial paths because it's nested inside "if
(partially_grouped_rel && partially_grouped_rel->partial_pathlist)"

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Junwang Zhao 2024-02-01 03:43:07 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Richard Guo 2024-02-01 03:28:54 Re: set_cheapest without checking pathlist