Re: OLAP CUBE/ROLLUP Operators and GROUP BY grouping sets

From: "Robert Bedell" <robert(at)friendlygenius(dot)com>
To: "'Robert Bedell'" <robert(at)friendlygenius(dot)com>, "'Hannu Krosing'" <hannu(at)tm(dot)ee>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: OLAP CUBE/ROLLUP Operators and GROUP BY grouping sets
Date: 2003-12-18 00:26:24
Message-ID: 200312171926323.SM00984@xavier
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> > For pure ROLLUP one could shortcut the split-into-groups and
> > put-together-again process, as ROLLUP is already doable from single
> > sorted scan.
>
> Actually as long as the grouping sets are all left-continuous of the
> longest
> grouping set it's doable from a single sorted scan. If done with the
> right
> implementation separating resetable aggregators and out of order
> aggregators
> you could get this optimization for free. This avoids having to look for
> ROLLUP specifically.

Ok, putting it that way was kind of dumb - and you already said that mostly.
What I mean to say is you don't have to check for ROLLUP specifically to get
that optimization.. This also allows you to do "GROUP BY a, b, ROLLUP(c,d)"
(resulting in grouping sets {{a,b,c,d},{a,b,c},{a,b}}) in an optimized
fashion without having to check for PURE rollup.

Cheers,

Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan Gardner 2003-12-18 00:48:33 Limiting per user and per db accesse (was TODO list)
Previous Message Robert Bedell 2003-12-18 00:15:07 Re: OLAP CUBE/ROLLUP Operators and GROUP BY grouping sets