Re: allow LIMIT in UPDATE and DELETE - Mailing list pgsql-general

From Tom Lane
Subject Re: allow LIMIT in UPDATE and DELETE
Date
Msg-id 2296.1148057843@sss.pgh.pa.us
Whole thread Raw
In response to Re: allow LIMIT in UPDATE and DELETE  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Err, you don't need an index on ctid because the ctid represents that
> physical location of the tuple on disk. ctids are what indexes use to
> refer to tuples...

> # explain DELETE FROM t WHERE ctid=(SELECT ctid FROM t WHERE pronargs=1 LIMIT 1);

This doesn't currently work for more than one tuple, though: the natural
locution would be "WHERE ctid IN (SELECT returning more than one tid)"
but the planner/executor don't cope with doing that efficiently.  Might
be worth trying to fix that.

            regards, tom lane

pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: allow LIMIT in UPDATE and DELETE
Next
From: Joachim Wieland
Date:
Subject: Re: VACUUM FULL hangs on ordinary table