From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Lazarus <andrew@pillette.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: when is a DELETE FK trigger planned?
Date: Mon, 25 Feb 2008 20:25:10 -0500
Message-ID: <19945.1203989110@sss.pgh.pa.us> (raw)
In-Reply-To: <010161370.20080225125626@pillette.com>
References: <010161370.20080225125626@pillette.com>
Andrew Lazarus <andrew@pillette.com> writes:
> I have a cascading delete trigger that is obviously using a seqscan.
> (Explain analyze shows that trigger as taking over 1000s while all
> other triggers are <1s. The value in test delete didn't even appear in
> this child table, so an index scan would have been almost instant.)
> If I do
> DELETE FROM child_table WHERE fkey = value;
> I get an index scan. Why doesn't the trigger do that, and how can I
> force it to re-plan?
That would depend on what PG version you're using.
However, starting a fresh connection should get you a new trigger
function plan in any case.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, andrew@pillette.com
Subject: Re: when is a DELETE FK trigger planned?
In-Reply-To: <19945.1203989110@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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