1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

Restructure planner's handling of inheritance. Rather than processing

inheritance trees on-the-fly, which pretty well constrained us to considering
only one way of planning inheritance, expand inheritance sets during the
planner prep phase, and build a side data structure that can be consulted
later to find which RTEs are members of which inheritance sets.  As proof of
concept, use the data structure to plan joins against inheritance sets more
efficiently: we can now use indexes on the set members in inner-indexscan
joins.  (The generated plans could be improved further, but it'll take some
executor changes.)  This data structure will also support handling UNION ALL
subqueries in the same way as inheritance sets, but that aspect of it isn't
finished yet.
This commit is contained in:
Tom Lane
2006-01-31 21:39:25 +00:00
parent 097df388b7
commit 8a1468af4e
18 changed files with 1042 additions and 508 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.324 2005/12/28 01:29:59 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.325 2006/01/31 21:39:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1322,6 +1322,25 @@ _copyInClauseInfo(InClauseInfo *from)
return newnode;
}
/*
* _copyAppendRelInfo
*/
static AppendRelInfo *
_copyAppendRelInfo(AppendRelInfo *from)
{
AppendRelInfo *newnode = makeNode(AppendRelInfo);
COPY_SCALAR_FIELD(parent_relid);
COPY_SCALAR_FIELD(child_relid);
COPY_SCALAR_FIELD(parent_reltype);
COPY_SCALAR_FIELD(child_reltype);
COPY_NODE_FIELD(col_mappings);
COPY_NODE_FIELD(translated_vars);
COPY_SCALAR_FIELD(parent_reloid);
return newnode;
}
/* ****************************************************************
* parsenodes.h copy functions
* ****************************************************************
@ -2945,6 +2964,9 @@ copyObject(void *from)
case T_InClauseInfo:
retval = _copyInClauseInfo(from);
break;
case T_AppendRelInfo:
retval = _copyAppendRelInfo(from);
break;
/*
* VALUE NODES