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

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

"Robert Bedell" <robert(at)friendlygenius(dot)com> writes:
> 1) When does the optimizer set the nodeAgg plan to HASHED?

See grouping_planner() in src/backend/optimizer/plan/planner.c
particularly the logic around use_hashed_grouping.

> 2) What mechanism would be best to use for storing the data on disk? I know
> there is a temporary table mechanism, I'll be hunting for that shortly..

Temp files, not temp tables. You could look at
src/backend/utils/sort/tuplesort.c or src/backend/executor/nodeHash.c
for examples.

> 3) What should define the spillover point.

sort_mem.

> The documentation points to the
> 'sort_mem' parameter for this, but the code doesn't look to actually
> implement that yet.

Well, yeah, that's sort of exactly the point ... it's considered during
planning but the executor code has no fallback if the planner guesses
wrong.

> 4) Should LookupTupleHashEntry() be worried about the pointers it
> receives...similarly for hash_search()?

Eh?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Bedell 2003-12-18 04:25:34 Re: OLAP CUBE/ROLLUP Operators and GROUP BY grouping sets
Previous Message Robert Bedell 2003-12-18 04:08:43 Re: OLAP CUBE/ROLLUP Operators and GROUP BY grouping sets