mirror of
https://github.com/postgres/postgres.git
synced 2025-07-17 06:41:09 +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:
@ -265,8 +265,8 @@ print_rt(List *rtable)
|
||||
switch (rte->rtekind)
|
||||
{
|
||||
case RTE_RELATION:
|
||||
printf("%d\t%s\t%u",
|
||||
i, rte->eref->aliasname, rte->relid);
|
||||
printf("%d\t%s\t%u\t%c",
|
||||
i, rte->eref->aliasname, rte->relid, rte->relkind);
|
||||
break;
|
||||
case RTE_SUBQUERY:
|
||||
printf("%d\t%s\t[subquery]",
|
||||
@ -276,10 +276,6 @@ print_rt(List *rtable)
|
||||
printf("%d\t%s\t[join]",
|
||||
i, rte->eref->aliasname);
|
||||
break;
|
||||
case RTE_SPECIAL:
|
||||
printf("%d\t%s\t[special]",
|
||||
i, rte->eref->aliasname);
|
||||
break;
|
||||
case RTE_FUNCTION:
|
||||
printf("%d\t%s\t[rangefunction]",
|
||||
i, rte->eref->aliasname);
|
||||
|
Reference in New Issue
Block a user