X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ECA5553917 for ; Tue, 29 Mar 2005 15:56:52 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77801-01 for ; Tue, 29 Mar 2005 14:56:49 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3E85D538D5 for ; Tue, 29 Mar 2005 15:56:48 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j2TEufSh021617; Tue, 29 Mar 2005 09:56:41 -0500 (EST) To: Stephan Szabo Cc: Simon Riggs , Karim A Nassar , Christopher Kings-Lynne , pgsql-performance@postgresql.org Subject: Re: Delete query takes exorbitant amount of time In-reply-to: <20050329061837.A51620@megazone.bigpanda.com> References: <1112095776.11750.958.camel@localhost.localdomain> <20050329054714.V50612@megazone.bigpanda.com> <20050329061837.A51620@megazone.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Tue, 29 Mar 2005 06:20:25 -0800" Date: Tue, 29 Mar 2005 09:56:41 -0500 Message-ID: <21616.1112108201@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/632 X-Sequence-Number: 11337 Stephan Szabo writes: > If there were some way to pass a "limit" into SPI_prepare that was treated > similarly to a LIMIT clause for planning purposes but didn't actually > change the output plan to only return that number of rows, we could use > that. Hmm ... the planner does have the ability to do that sort of thing (we use it for cursors). SPI_prepare doesn't expose the capability. Perhaps adding a SPI_prepare variant that does expose it would be the quickest route to a solution. I get a headache every time I look at the RI triggers ;-). Do they always know at the time of preparing a plan which way it will be used? regards, tom lane