Re: [HACKERS] GROUP BY on a large table -- an idea

2006-10-15 Thread Markus Schaber
Hi, Dawid, Dawid Kuroczko wrote: The hybrid approach means: sort as much as you can without spilling to disk, then aggregate and store aggregate state variables in safe place (like a tree above), get more tuples from the table, sort them, update aggregate state variables, lather, rince,

[HACKERS] GROUP BY on a large table -- an idea

2006-10-12 Thread Dawid Kuroczko
Recently I've been playing with quite a big table (over 50mln rows), and did some SELECT ... sum(...) WHERE ... GROUP BY ... queries. The usual plan for these is to sort the entries according to GROUP BY specification, then to run aggregates one by one. If the data to be sorted is large enough,

Re: [HACKERS] GROUP BY on a large table -- an idea

2006-10-12 Thread Martijn van Oosterhout
On Thu, Oct 12, 2006 at 09:52:11AM +0200, Dawid Kuroczko wrote: Recently I've been playing with quite a big table (over 50mln rows), and did some SELECT ... sum(...) WHERE ... GROUP BY ... queries. The usual plan for these is to sort the entries according to GROUP BY specification, then to