1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Avoid listing the same ResultRelInfo in more than one EState list.

Doing so causes EXPLAIN ANALYZE to show trigger statistics multiple
times.  Commit 2f17844104 seems to
be to blame for this.

Amit Langote, revieed by Amit Khandekar, Etsuro Fujita, and me.
This commit is contained in:
Robert Haas
2018-02-08 14:29:05 -05:00
parent 88fdc70060
commit e44dd84325
5 changed files with 27 additions and 12 deletions

View File

@ -1413,8 +1413,11 @@ ExecGetTriggerResultRel(EState *estate, Oid relid)
rInfo++;
nr--;
}
/* Third, search through the leaf result relations, if any */
foreach(l, estate->es_leaf_result_relations)
/*
* Third, search through the result relations that were created during
* tuple routing, if any.
*/
foreach(l, estate->es_tuple_routing_result_relations)
{
rInfo = (ResultRelInfo *) lfirst(l);
if (RelationGetRelid(rInfo->ri_RelationDesc) == relid)