Re: LIMIT for UPDATE and DELETE - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: LIMIT for UPDATE and DELETE
Date
Msg-id 540ED863.6020402@joh.to
Whole thread Raw
In response to Re: LIMIT for UPDATE and DELETE  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: LIMIT for UPDATE and DELETE  (Marko Tiikkaja <marko@joh.to>)
List pgsql-hackers
On 9/9/14 11:57 AM, Heikki Linnakangas wrote:
> What's not clear to me is whether it make sense to do 1) without 2) ? Is
> UPDATE .. LIMIT without support for an ORDER BY useful enough?

I'd say so; I could use it right now.  I have to remove millions of 
lines from a table, but I don't want the live transaction processing to 
take a hit, so I have to do it in batches.  Granted, some kind of rate 
limiting would achieve the same thing for DELETE, but with UPDATE you 
also have to consider row locking, and rate limiting wouldn't help with 
that at all; it would, in fact, just make it worse.  I'll also be 
running a big UPDATE like that later today, so that's two uses today 
alone for me.  And no, these are not routine things so keep your "use 
partitions" suggestions to yourselves.

> And if we
> apply this patch now, how much of it needs to be rewritten after 2) ? If
> the answers are "yes" and "not much", then we should review this patch
> now, and put 2) on the TODO list. Otherwise 2) should do done first.

I'd say "not much, if anything at all".


.marko



pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Escaping from blocked send() reprised.
Next
From: Marko Tiikkaja
Date:
Subject: Re: LIMIT for UPDATE and DELETE