diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-11-01 05:09:18 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-11-01 05:09:18 +0000 |
commit | e81ad79de0cc1198d34470d509e047d9ec72f036 (patch) | |
tree | 16b612f31fac6117ccc15ca08da12f486792ec62 /src/backend/executor/nodeAppend.c | |
parent | d40dbb7387a50b1319d84cb596a854f1688302db (diff) | |
download | postgresql-e81ad79de0cc1198d34470d509e047d9ec72f036.tar.gz postgresql-e81ad79de0cc1198d34470d509e047d9ec72f036.zip |
Don't call ExecOpenIndices if pg_class relhasindex shows there are no
indexes to open. Avoid unnecessary work in ExecCheckPerm, too.
Diffstat (limited to 'src/backend/executor/nodeAppend.c')
-rw-r--r-- | src/backend/executor/nodeAppend.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/executor/nodeAppend.c b/src/backend/executor/nodeAppend.c index e04113149fa..eb0c5788521 100644 --- a/src/backend/executor/nodeAppend.c +++ b/src/backend/executor/nodeAppend.c @@ -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; } |