Re: allow LIMIT in UPDATE and DELETE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: allow LIMIT in UPDATE and DELETE
Date: 2006-05-19 16:57:23
Message-ID: 2296.1148057843@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joachim Wieland 2006-05-19 17:03:23 Re: VACUUM FULL hangs on ordinary table
Previous Message Csaba Nagy 2006-05-19 16:46:42 Re: allow LIMIT in UPDATE and DELETE