Re: LIMIT for UPDATE and DELETE

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Rukh Meski <rukh(dot)meski(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: LIMIT for UPDATE and DELETE
Date: 2014-09-09 16:28:21
Message-ID: CAMkU=1xQ5bDvKSc=OsRtFvJfMYF3dSsDE-kg8cz_1PiDDbFbyw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 9, 2014 at 2:57 AM, Heikki Linnakangas <hlinnakangas(at)vmware(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2014-09-09 16:33:46 Re: pg_background (and more parallelism infrastructure patches)
Previous Message Andres Freund 2014-09-09 16:25:04 Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]