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)
commit2428df0779cf63666f9be0146222d570924a9af5
tree55864d92133b9477b8e0c3257b43332811bb9df5
parent57067da460bd475663055b121bc76d0b16b7f394
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