Arrange to cache a ResultRelInfo in the executor's EState for relations that
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 15 Aug 2007 21:39:50 +0000 (21:39 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 15 Aug 2007 21:39:50 +0000 (21:39 +0000)
commit817946bb04e1dcac02d85572103f1e1381102a0a
tree221b38d8cae6163c5d4f9e9248e1555f9042e685
parent9cb84097623e5efe32b7289ca3c403f70ee152d8
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.
src/backend/commands/explain.c
src/backend/commands/trigger.c
src/backend/executor/execMain.c
src/backend/executor/execUtils.c
src/include/executor/executor.h
src/include/nodes/execnodes.h