Re: pg16: XX000: could not find pathkey item to sort - Mailing list pgsql-hackers

From David Rowley
Subject Re: pg16: XX000: could not find pathkey item to sort
Date
Msg-id CAApHDvr4Te8EbPDnYfHPAxRnuwMdojavUR=Prejm5AphBq41dg@mail.gmail.com
Whole thread Raw
In response to Re: pg16: XX000: could not find pathkey item to sort  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: pg16: XX000: could not find pathkey item to sort
List pgsql-hackers
On Thu, 14 Mar 2024 at 18:23, Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:
> I don't understand why root->query_pathkeys has both a and b. "a" is there because of GROUP BY and ORDER BY clause.
Butwhy "b"?
 

So that the ORDER BY aggregate function can be evaluated without
nodeAgg.c having to perform the sort. See
adjust_group_pathkeys_for_groupagg().

David



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Make attstattarget nullable
Next
From: Amit Kapila
Date:
Subject: Re: Have pg_basebackup write "dbname" in "primary_conninfo"?