pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How do I see what triggers are called on cascade?
2+ messages / 2 participants
[nested] [flat]

* How do I see what triggers are called on cascade?
@ 2004-08-24 00:02 andrew@pillette.com
  2004-08-24 02:50 ` Re: How do I see what triggers are called on cascade? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: andrew@pillette.com @ 2004-08-24 00:02 UTC (permalink / raw)
  To: pgsql-performance

I'm still having trouble with slow cascading DELETEs. What commands can I issue to see the sequence of events that occurs after I execute 

DELETE FROM x WHERE p;

so that I can see if indexes being used correctly, or I have a constraint I don't want, etc.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How do I see what triggers are called on cascade?
  2004-08-24 00:02 How do I see what triggers are called on cascade? andrew@pillette.com
@ 2004-08-24 02:50 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-08-24 02:50 UTC (permalink / raw)
  To: andrew@pillette.com; +Cc: pgsql-performance

andrew@pillette.com writes:
> I'm still having trouble with slow cascading DELETEs. What commands can I issue to see the sequence of events that occurs after I execute 
> DELETE FROM x WHERE p;
> so that I can see if indexes being used correctly, or I have a constraint I don't want, etc.

I'd suggest starting a fresh backend, turning on log_statement, and then
issuing the DELETE.  log_statement will log the queries generated by the
foreign-key triggers ... but only the first time through, because those
triggers cache the query plans.

The queries you will see will be parameterized (they'll use $1,$2,etc).
You can use PREPARE and EXPLAIN ANALYZE EXECUTE to investigate what sort
of plans result.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-08-24 02:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-08-24 00:02 How do I see what triggers are called on cascade? andrew@pillette.com
2004-08-24 02:50 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox