Re: WIP: make EXPLAIN ANALYZE show time spent in triggers - Mailing list pgsql-patches

From Christopher Kings-Lynne
Subject Re: WIP: make EXPLAIN ANALYZE show time spent in triggers
Date
Msg-id 4243B453.6080801@familyhealth.com.au
Whole thread Raw
In response to WIP: make EXPLAIN ANALYZE show time spent in triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WIP: make EXPLAIN ANALYZE show time spent in triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> The attached patch allows EXPLAIN ANALYZE to break out the time spent in
> triggers when EXPLAINing a statement that can fire triggers.  Formerly
> this time was included in "Total runtime" but not otherwise accounted
> for.

Very nice.

> An example is
>
> regression=# explain analyze delete from foo;
>                                                QUERY PLAN
> --------------------------------------------------------------------------------------------------------
>  Seq Scan on foo  (cost=0.00..172.70 rows=11770 width=6) (actual time=0.063..86.650 rows=10000 loops=1)
>  Trigger RI_ConstraintTrigger_60781: time=3899.609 calls=10000
>  Total runtime: 4218.309 ms
> (3 rows)

Could we get plain EXPLAIN output as well:

regression=# explain analyze delete from foo;
                                                QUERY PLAN

--------------------------------------------------------------------------------------------------------
  Seq Scan on foo  (cost=0.00..172.70 rows=11770 width=6)
  Trigger RI_ConstraintTrigger_60781: calls=11770
(2 rows)

Also, have you considered statement level triggers?

Chris

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: WIP: make EXPLAIN ANALYZE show time spent in triggers
Next
From: Tom Lane
Date:
Subject: Re: WIP: make EXPLAIN ANALYZE show time spent in triggers