Re: Planning aggregates which require sorted or distinct

From: Gavin Sherry <swm(at)alcove(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Planning aggregates which require sorted or distinct
Date: 2007-01-19 21:53:09
Message-ID: Pine.LNX.4.58.0701200849210.9466@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 19 Jan 2007, Tom Lane wrote:

> Gavin Sherry <swm(at)alcove(dot)com(dot)au> writes:
> > What we want to do is have a kind of 'sub plan' for each aggregate. In
> > effect, the plan might start looking like a directed graph. Here is part
> > of the plan as a directed graph.
>
> > GroupAggregate
> > /-----------------^---------------...
> > | |
> > | |
> > ^ |
> > | Unique
> > | ^
> > | |
> > Sort Sort
> > (saledate) (saledate,prodid)
> > ^ ^
> > | |
> > -------------- Fan Out ------------...
> > ^
> > |
> > Scan
>
> > This idea was presented by Brian Hagenbuch at Greenplum. He calls it a
> > 'Fan Out' plan. It is trivial to rejoin the data because all data input to
> > the aggregates is sorted by the same primary key.
>
> Er, what primary key would that be exactly? And even if you had a key,
> I wouldn't call joining on it trivial; I'd call it expensive ...

I should have used slightly different language. What I meant to say was,
both sets are primarily sorted by saledate so they can be merged back
together. This is why I said it was trivial.

Thanks,

Gavin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-01-19 22:31:29 Re: [PATCHES] [HACKERS] [Fwd: Index Advisor]
Previous Message Bruce Momjian 2007-01-19 21:36:50 Re: [HACKERS] Autovacuum Improvements