Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group