Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support
Date: 2009-12-20 21:21:01
Message-ID: 162867790912201321v50da73c4ta169aedd62970b7f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/12/20 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> I am thinking about implementation of median function. This function
>> should be implemented in two ways:
>
>> a) direct entering an ORDER BY clause for median funcall in gram.y
>> b) general support for "preordered aggregates".
>
>> I prefer plan b, because there are more similar aggregates - like
>> Quantiles.
>
> This seems like a great deal of mechanism to solve a very localized
> problem.
>

plan a doesn't block plan b - it is very simple. So we can start with a.

> I think that we've already expanded the capabilities of aggregates
> a great deal for 8.5, and we should let it sit as-is for a release
> or two and see what the real user demand is for additional features.
>
> I'm particularly concerned by the fact that the feature set is already
> far out in front of what the planner can optimize effectively (e.g.,
> there's no ability to combine the work when multiple aggregates need the
> same sorted data).  The more features we add on speculation, the harder
> it's going to be to close that gap.

I didn't thing about this optimalisation, but this point could not be
impossible. Bigger problem is using of indexes.

>
> Another risk is that features added now might preclude adding others
> later.
>

sure. It was my question, what is preferred.

Regards
Pavel

>                        regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2009-12-20 21:23:05 Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support
Previous Message Tom Lane 2009-12-20 21:08:37 Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support