diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-08-15 21:39:50 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-08-15 21:39:50 +0000 |
commit | 817946bb04e1dcac02d85572103f1e1381102a0a (patch) | |
tree | 221b38d8cae6163c5d4f9e9248e1555f9042e685 /src/include/executor | |
parent | 9cb84097623e5efe32b7289ca3c403f70ee152d8 (diff) | |
download | postgresql-817946bb04e1dcac02d85572103f1e1381102a0a.tar.gz postgresql-817946bb04e1dcac02d85572103f1e1381102a0a.zip |
Arrange to cache a ResultRelInfo in the executor's EState for relations that
are not one of the query's defined result relations, but nonetheless have
triggers fired against them while the query is active. This was formerly
impossible but can now occur because of my recent patch to fix the firing
order for RI triggers. Caching a ResultRelInfo avoids duplicating work by
repeatedly opening and closing the same relation, and also allows EXPLAIN
ANALYZE to "see" and report on these extra triggers. Use the same mechanism
to cache open relations when firing deferred triggers at transaction shutdown;
this replaces the former one-element-cache strategy used in that case, and
should improve performance a bit when there are deferred triggers on a number
of relations.
Diffstat (limited to 'src/include/executor')
-rw-r--r-- | src/include/executor/executor.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 539e2f6fca7..f4272cb758b 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.141 2007/06/11 22:22:42 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.142 2007/08/15 21:39:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -138,6 +138,7 @@ extern TupleTableSlot *ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count); extern void ExecutorEnd(QueryDesc *queryDesc); extern void ExecutorRewind(QueryDesc *queryDesc); +extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid); extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids); extern void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate); |