mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Don't call ExecOpenIndices if pg_class relhasindex shows there are no
indexes to open. Avoid unnecessary work in ExecCheckPerm, too.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.27 1999/10/30 23:13:30 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.28 1999/11/01 05:09:18 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -181,7 +181,6 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent)
|
||||
{
|
||||
AppendState *appendstate;
|
||||
int nplans;
|
||||
List *resultList = NULL;
|
||||
List *rtable;
|
||||
List *appendplans;
|
||||
bool *initialized;
|
||||
@ -246,13 +245,14 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent)
|
||||
if ((es_rri != (RelationInfo *) NULL) &&
|
||||
(node->inheritrelid == es_rri->ri_RangeTableIndex))
|
||||
{
|
||||
RelationInfo *rri;
|
||||
List *resultList = NIL;
|
||||
List *rtentryP;
|
||||
|
||||
foreach(rtentryP, rtable)
|
||||
{
|
||||
Oid reloid;
|
||||
RangeTblEntry *rtentry = lfirst(rtentryP);
|
||||
RangeTblEntry *rtentry = lfirst(rtentryP);
|
||||
Oid reloid;
|
||||
RelationInfo *rri;
|
||||
|
||||
reloid = rtentry->relid;
|
||||
rri = makeNode(RelationInfo);
|
||||
@ -262,8 +262,10 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent)
|
||||
rri->ri_IndexRelationDescs = NULL; /* index descs */
|
||||
rri->ri_IndexRelationInfo = NULL; /* index key info */
|
||||
|
||||
if (rri->ri_RelationDesc->rd_rel->relhasindex)
|
||||
ExecOpenIndices(reloid, rri);
|
||||
|
||||
resultList = lcons(rri, resultList);
|
||||
ExecOpenIndices(reloid, rri);
|
||||
}
|
||||
appendstate->as_result_relation_info_list = resultList;
|
||||
}
|
||||
|
Reference in New Issue
Block a user