Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4D4712E018C for ; Mon, 25 Feb 2008 17:02:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 52580-03-3 for ; Mon, 25 Feb 2008 17:02:34 -0400 (AST) X-Greylist: delayed 00:37:27.64517 by SQLgrey-1.7.5 Received: from pillette.com (adsl-67-119-5-202.dsl.snfc21.pacbell.net [67.119.5.202]) by postgresql.org (Postfix) with ESMTP id 0B23D2E003D for ; Mon, 25 Feb 2008 17:02:24 -0400 (AST) Received: from dhcp203.pillette.com (dhcp203.pillette.com [192.168.1.203]) by pillette.com (8.11.6/8.11.6) with ESMTP id m1PKOun22655 for ; Mon, 25 Feb 2008 12:24:56 -0800 Date: Mon, 25 Feb 2008 12:56:26 -0800 From: Andrew Lazarus X-Mailer: The Bat! (v4.0.14) Home Organization: Pillette Investment Management X-Priority: 3 (Normal) Message-ID: <010161370.20080225125626@pillette.com> To: pgsql-performance@postgresql.org Subject: when is a DELETE FK trigger planned? MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.885 tagged_above=0 required=5 tests=AWL=-0.108, FH_HOST_EQ_PACBELL_D=0.893, RDNS_DYNAMIC=0.1 X-Spam-Level: X-Archive-Number: 200802/331 X-Sequence-Number: 28873 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 =3D value; I get an index scan. Why doesn't the trigger do that, and how can I force it to re-plan?