pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <mail@joeconway.com>
Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>
Cc: Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Bernd Helmle <mailings@oopsware.de>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: Susanne Ebrecht <susanne.ebrecht@credativ.de>
Subject: Re: [PATCHES] 8.2 features?
Date: Thu, 20 Jul 2006 20:46:13 -0400
Message-ID: <14047.1153442773@sss.pgh.pa.us> (raw)
In-Reply-To: <44C00E1E.1000405@joeconway.com>
References: <44B69778.5050104@dunslane.net>
	<50461.84.63.113.55.1152832991.squirrel@pezone.net>
	<ECCAAC0A3182895D3D12B0E8@[172.26.14.247]>
	<44B7ADFC.90205@dunslane.net>
	<44BC0432.3040509@joeconway.com>
	<44BC661F.80609@joeconway.com>
	<44BCD06C.3060409@calorieking.com>
	<44BCF1D4.3010807@dunslane.net>
	<5842.1153246741@sss.pgh.pa.us>
	<44BD8854.9060506@calorieking.com>
	<15212.1153279954@sss.pgh.pa.us>
	<44BDB2F5.7080003@joeconway.com>
	<44BEA710.6060700@joeconway.com>
	<23198.1153367887@sss.pgh.pa.us>
	<44BF0382.2010501@joeconway.com>
	<23454.1153370214@sss.pgh.pa.us>
	<44BF122F.1080200@joeconway.com>
	<23927.1153373971@sss.pgh.pa.us>
	<44C00E1E.1000405@joeconway.com>

Joe Conway <mail@joeconway.com> writes:
> I'm liking this too. But when you say "jointree node", are you saying to 
> model the new node type after NestLoop/MergeJoin/HashJoin nodes? These 
> are referred to as "join nodes" in ExecInitNode. Or as you mentioned a 
> couple of times, should this look more like an Append node?

No, I guess I confused you by talking about the executor representation
at the same time.  This is really unrelated to the executor.  The join
tree I'm thinking of here is the data structure that dangles off
Query.jointree --- it's a representation of the query's FROM clause,
and (at present) can contain RangeTblRef, FromExpr, and JoinExpr nodes.
See the last hundred or so lines of primnodes.h for some details.
The jointree is used by the planner to compute the plan node tree that
the executor will run, but it's not the same thing.

There are basically two ways you could go about this:
1. Make a new jointree leaf node type to represent a VALUES construct,
   and dangle the list of lists of expressions off that.
2. Make a new RangeTblEntry type to represent a VALUES construct, and
   just put a RangeTblRef to it into the jointree.  The expressions
   dangle off the RangeTblEntry.

Offhand I'm not certain which of these would be cleanest.  The second
way has some similarities to the way we handle set operation trees
(UNION et al), so it might be worth looking at that stuff.  However,
being a RangeTblEntry has a lot of baggage (eg, various routines expect
to find an RTE alias, column names, column types, etc) and maybe we
don't need all that for VALUES.

One advantage of the first way is that you could use the same node
type for the "raw parser output" delivered by gram.y.  This is a bit of
a type cheat, because raw parser output is logically distinct from what
parse analysis produces, but we do it in lots of other places too
(JoinExpr for instance is used that way).  You should in any case have a
clear idea of the difference between the raw and analyzed parser
representations --- for instance, the raw form won't contain any
datatype info, whereas the analyzed form must.  This might or might not
need to be visible directly in the VALUES node --- it might be that you
can rely on the datatype info embedded in the analyzed expressions.

			regards, tom lane



view thread (56+ messages)  latest in thread

Message-ID: <14047.1153442773@sss.pgh.pa.us>
Permalink:  ../14047.1153442773@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14047.1153442773@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mail@joeconway.com, chris.kings-lynne@calorieking.com, pgsql-hackers@postgresql.org, andrew@dunslane.net, mailings@oopsware.de, peter_e@gmx.net, susanne.ebrecht@credativ.de
  Subject: Re: [PATCHES] 8.2 features?
  In-Reply-To: <14047.1153442773@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox