Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0ED804761ED; Mon, 10 Jun 2002 13:19:15 -0400 (EDT) Received: from taru.tm.ee (unknown [213.180.2.168]) by postgresql.org (Postfix) with ESMTP id F0CE1476107; Mon, 10 Jun 2002 12:33:19 -0400 (EDT) Received: (from hannu@localhost) by taru.tm.ee (8.11.6/8.11.6) id g5AHXms06066; Mon, 10 Jun 2002 19:33:48 +0200 X-Authentication-Warning: taru.tm.ee: hannu set sender to hannu@tm.ee using -f Subject: Re: [HACKERS] Efficient DELETE Strategies From: Hannu Krosing To: Tom Lane Cc: Christoph Haller , pgsql-sql@postgresql.org, pgsql-hackers@postgresql.org In-Reply-To: <5619.1023717387@sss.pgh.pa.us> References: <200206101142.NAA16854@rodos> <5619.1023717387@sss.pgh.pa.us> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3.99 Date: 10 Jun 2002 19:33:48 +0200 Message-Id: <1023730428.4092.64.camel@taru.tm.ee> Mime-Version: 1.0 X-Archive-Number: 200206/131 X-Sequence-Number: 8096 On Mon, 2002-06-10 at 15:56, Tom Lane wrote: > Christoph Haller writes: > > Based on an entry in the mailing list from 30 Oct 2001 > > about efficient deletes on subqueries, > > I've found two ways to do so (PostgreSQL 7.2.1): > > ... > > Is there a way to put the second form (more complicated, but faster) > > in one statement? > > Or is there even a third way to delete, which I cannot see? ... > AFAIK this extension would be utterly trivial to implement, since all > the machinery is there already --- for 99% of the backend, it doesn't > matter whether a FROM-item is implicit or explicit. We'd only need to > argue out what the syntax should be. I could imagine > > DELETE FROM relation_expr [ , table_ref [ , ... ] ] > [ WHERE bool_expr ] > > or > > DELETE FROM relation_expr [ FROM table_ref [ , ... ] ] > [ WHERE bool_expr ] What about DELETE relation_expr FROM relation_expr [ , table_ref [ , ... ] ] [ WHERE bool_expr ] or DELETE relation_expr.* FROM relation_expr [ , table_ref [ , ... ] ] [ WHERE bool_expr ] -------------- Hannu