Re: WITHIN GROUP patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WITHIN GROUP patch
Date
Msg-id 23961.1386092640@sss.pgh.pa.us
Whole thread Raw
In response to Re: WITHIN GROUP patch  (Atri Sharma <atri.jiit@gmail.com>)
Responses Re: WITHIN GROUP patch
List pgsql-hackers
Atri Sharma <atri.jiit@gmail.com> writes:
> Please find attached the latest patch for WITHIN GROUP. This patch is
> after fixing the merge conflicts.

I've started to look at this patch now.  I have a couple of immediate
reactions to the catalog changes:

1. I really hate the way you've overloaded the transvalue to do something
that has approximately nothing to do with transition state (and haven't
updated catalogs.sgml to explain that, either).  Seems like it'd be
cleaner to just hardwire a bool column that distinguishes regular and
hypothetical input rows.  And why do you need aggtranssortop for that?
I fail to see the point of sorting on the flag column.

2 I also don't care for the definition of aggordnargs, which is the number
of direct arguments to an ordered set function, except when it isn't.
Rather than overloading it to be both a count and a couple of flags,
I wonder whether we shouldn't expand aggisordsetfunc to be a three-way
"aggregate kind" field (ordinary agg, ordered set, or hypothetical set
function).
        regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: UNNEST with multiple args, and TABLE with multiple funcs
Next
From: Andres Freund
Date:
Subject: Re: pgsql: Fix a couple of bugs in MultiXactId freezing