• Tom Lane's avatar
    Arrange to cache a ResultRelInfo in the executor's EState for relations that · 817946bb
    Tom Lane authored
    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.
    817946bb
trigger.c 93.8 KB