diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-22 22:00:26 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-22 22:00:26 +0000 |
commit | eab6b8b27eba54b8fd0ad3f64989d12200979c96 (patch) | |
tree | ca4fad45c65c60b7900df6e373bd5999993ea2b1 /src/backend/executor/execUtils.c | |
parent | 849000c7823d604270094aea76fc530b6cfe9466 (diff) | |
download | postgresql-eab6b8b27eba54b8fd0ad3f64989d12200979c96.tar.gz postgresql-eab6b8b27eba54b8fd0ad3f64989d12200979c96.zip |
Turn the rangetable used by the executor into a flat list, and avoid storing
useless substructure for its RangeTblEntry nodes. (I chose to keep using the
same struct node type and just zero out the link fields for unneeded info,
rather than making a separate ExecRangeTblEntry type --- it seemed too
fragile to have two different rangetable representations.)
Along the way, put subplans into a list in the toplevel PlannedStmt node,
and have SubPlan nodes refer to them by list index instead of direct pointers.
Vadim wanted to do that years ago, but I never understood what he was on about
until now. It makes things a *whole* lot more robust, because we can stop
worrying about duplicate processing of subplans during expression tree
traversals. That's been a constant source of bugs, and it's finally gone.
There are some consequent simplifications yet to be made, like not using
a separate EState for subplans in the executor, but I'll tackle that later.
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r-- | src/backend/executor/execUtils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index d9957573883..d188a38489d 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.145 2007/02/20 17:32:14 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.146 2007/02/22 22:00:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -847,7 +847,6 @@ ExecRelationIsTargetRelation(EState *estate, Index scanrelid) Relation ExecOpenScanRelation(EState *estate, Index scanrelid) { - RangeTblEntry *rtentry; Oid reloid; LOCKMODE lockmode; ResultRelInfo *resultRelInfos; @@ -885,8 +884,7 @@ ExecOpenScanRelation(EState *estate, Index scanrelid) } /* OK, open the relation and acquire lock as needed */ - rtentry = rt_fetch(scanrelid, estate->es_range_table); - reloid = rtentry->relid; + reloid = getrelid(scanrelid, estate->es_range_table); return heap_open(reloid, lockmode); } |