Re: proposal: tuplestore, tuplesort aggregate functions - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: tuplestore, tuplesort aggregate functions
Date
Msg-id AANLkTi=zdEcnsH3EU4dRETP+NaTyAk0gKRnnfZfwyPn9@mail.gmail.com
Whole thread Raw
In response to Re: proposal: tuplestore, tuplesort aggregate functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal: tuplestore, tuplesort aggregate functions
Re: proposal: tuplestore, tuplesort aggregate functions
List pgsql-hackers
2010/8/18 Tom Lane <tgl@sss.pgh.pa.us>:
> David Fetter <david@fetter.org> writes:
>> Apart from the medians, which "median-like" aggregates do you have in
>> mind to start with?  If you can provide examples of "median-like"
>> aggregates that people might need to implement as user-defined
>> aggregates, or other places where people would use this machinery, it
>> will make your case stronger for this refactoring.
>
> There would be plenty of scope to re-use the machinery without any
> SQL-level extensions.  All you need is a polymorphic aggregate
> transition function that maintains a tuplestore or whatever.
> I don't see that extra syntax in CREATE AGGREGATE is really buying
> much of anything.
>

Have we to use a transisdent function? If we implement median as
special variant of aggregate - because we need to push an sort, then
we can skip a transident function function - and call directly final
function. This mechanism is used for aggregates with ORDER BY now. So
there can be a special path for direct call of final func. There is
useles to call transident function.

Regards

Pavel




>                        regards, tom lane
>


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: proposal: tuplestore, tuplesort aggregate functions
Next
From: Tom Lane
Date:
Subject: Re: proposal: tuplestore, tuplesort aggregate functions