Re: Aggregates with non-commutative transition functions

From: Emmanuel Charpentier <charpent(at)bacbuc(dot)dyndns(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Aggregates with non-commutative transition functions
Date: 2003-02-16 11:14:32
Message-ID: b2nrqm$v41$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> I said:
>
>>A better alternative is to get the planner to notice in the context of
>>the outer query that the inner query's result is already sorted by
>>recnum. Then it wouldn't do the unwanted sort in any case. This has
>>been on the to-do list for awhile, but hasn't risen to the top ...
>
>
> Now it has ... as of CVS tip, you can do

[ Nice demo ... ]

> Note the lack of an extra sort above the subquery. This provides a
> general technique for controlling the ordering of inputs to a
> user-written aggregate function, even when grouping.

Schön ! I suppose that this has other fringe benefits for planning in
general ...

Thanks a lot ! I'll try to build a secondary PostgreSQL from CVS on a
development machine to test it.

Do you plan incorporation in some forthcoming 7.3.x ? Or push it back to 7.4 ?

Emmanuel Charpentier

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco J Reyes 2003-02-16 15:49:54 Re: FreeBSD: SMP and PostgreSQL
Previous Message Colin Mangiagalli 2003-02-16 10:02:35 Transaction Logs Recycling Problem