On Thu, 14 Mar 2024 at 18:23, Ashutosh Bapat <ashutosh.bapat....@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. But why "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