1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Add a relkind field to RangeTblEntry to avoid some syscache lookups.

The recent additions for FDW support required checking foreign-table-ness
in several places in the parse/plan chain.  While it's not clear whether
that would really result in a noticeable slowdown, it seems best to avoid
any performance risk by keeping a copy of the relation's relkind in
RangeTblEntry.  That might have some other uses later, anyway.
Per discussion.
This commit is contained in:
Tom Lane
2011-02-22 19:23:23 -05:00
parent 1c51c7d5ff
commit bdca82f44d
19 changed files with 85 additions and 74 deletions

View File

@ -2275,8 +2275,8 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
switch (node->rtekind)
{
case RTE_RELATION:
case RTE_SPECIAL:
WRITE_OID_FIELD(relid);
WRITE_CHAR_FIELD(relkind);
break;
case RTE_SUBQUERY:
WRITE_NODE_FIELD(subquery);