Re: DELETE syntax on JOINS - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DELETE syntax on JOINS
Date
Msg-id 20195.1251208217@sss.pgh.pa.us
Whole thread Raw
In response to Re: DELETE syntax on JOINS  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: DELETE syntax on JOINS  (Andrew Dunstan <andrew@dunslane.net>)
Re: DELETE syntax on JOINS  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Aug 24, 2009 at 9:31 PM, Josh Berkus<josh@agliodbs.com> wrote:
>> What I don't get is why this is such a usability issue. �Subqueries in
>> DELETE FROM work perfectly well, and provide more flexibility than most
>> users know what to do with.

> It's both a usability issue and a performance issue.

On the usability front: if we were to take the position Josh advocates,
we should never have added FROM/USING to UPDATE/DELETE at all ... but
since we did, I think we should try to make it as flexible as the
corresponding feature in other DBMSes.

On the performance front: yeah, you can recast most joins as subqueries,
but you tend to end up with the equivalent of a nestloop plan.  Works
okay for small numbers of rows, scales horribly.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Werner Echezuria
Date:
Subject: return HeapTuple
Next
From: Andrew Dunstan
Date:
Subject: Re: DELETE syntax on JOINS