Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Simon Riggs
On Tue, 2006-12-26 at 10:47 -0500, Tom Lane wrote:
 As you can probably guess, I'm leaning to #3, but wanted to see if
 anyone had an objection or a better idea.

Is it possible to allocate the subquery in a child context of the main
query, so that it is technically a different context, yet can be freed
simultaneously?

Hierarchical queries seem like they'd need something like that?

Or should we have the context of a shared context, so that the subquery
can put info somewhere where the main context can read it?

I like the idea of freeing contexts as early as possible. We might not
do that now, but we might like to in the future.

-- 
  Simon Riggs 
  EnterpriseDB   http://www.enterprisedb.com



---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes:
 Is it possible to allocate the subquery in a child context of the main
 query, so that it is technically a different context, yet can be freed
 simultaneously?

That's exactly what the code *was* doing, but the problem is that we'd
free the child context during ExecEndSubqueryScan, at which point the
tupdesc is still needed.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Simon Riggs
On Wed, 2006-12-27 at 18:05 -0500, Tom Lane wrote:
 Simon Riggs [EMAIL PROTECTED] writes:
  Is it possible to allocate the subquery in a child context of the main
  query, so that it is technically a different context, yet can be freed
  simultaneously?
 
 That's exactly what the code *was* doing, but the problem is that we'd
 free the child context during ExecEndSubqueryScan, at which point the
 tupdesc is still needed.

OK, I guess my only other question is to do with recursive/hierarchical
queries: How will we handle those? All in same context?

I guess many subqueries are transformable into main joins anyway, so the
distinction is probably moot anyhow.

-- 
  Simon Riggs 
  EnterpriseDB   http://www.enterprisedb.com



---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes:
 OK, I guess my only other question is to do with recursive/hierarchical
 queries: How will we handle those? All in same context?

Offhand I don't think it matters.  Recursive queries are recursive in
the data, not in the plan tree.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend