Re: WIP: make EXPLAIN ANALYZE show time spent in triggers

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: WIP: make EXPLAIN ANALYZE show time spent in triggers
Date: 2005-03-25 06:48:51
Message-ID: 4243B453.6080801@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-03-25 06:53:57 Re: WIP: make EXPLAIN ANALYZE show time spent in triggers
Previous Message Tom Lane 2005-03-25 06:39:21 WIP: make EXPLAIN ANALYZE show time spent in triggers