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

From Jeff Janes
Subject Re: LIMIT for UPDATE and DELETE
Date
Msg-id CAMkU=1xQ5bDvKSc=OsRtFvJfMYF3dSsDE-kg8cz_1PiDDbFbyw@mail.gmail.com
Whole thread Raw
In response to Re: LIMIT for UPDATE and DELETE  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On Tue, Sep 9, 2014 at 2:57 AM, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:
 
I agree. If we are to support UPDATE .. ORDER BY .. LIMIT, it should work with inheritance. So the path forward is (using Marko's phrasing upthread):

   1) We put the LIMIT inside ModifyTable like this patch does.  This
doesn't prevent us from doing ORDER BY in the future, but helps numerous
people who today have to
   2) Someone rewrites how UPDATE works based on Tom's suggestion here:
http://www.postgresql.org/message-id/1598.1399826841@sss.pgh.pa.us,
which allows us to support ORDER BY on all tables (or perhaps maybe not
FDWs, I don't know how those work).  The LIMIT functionality in this
patch is unaffected.

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've wanted LIMIT even without ORDER BY many times, so I'd vote yes.

 
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.

On that I can't give any useful feedback. 


Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]
Next
From: Petr Jelinek
Date:
Subject: Re: pg_background (and more parallelism infrastructure patches)