Re: 9.5: UPDATE/DELETE .. ORDER BY .. LIMIT .. - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: 9.5: UPDATE/DELETE .. ORDER BY .. LIMIT ..
Date
Msg-id CAA4eK1KArdcAa2kbJO7Vrh-cxeBsMsv8eiDxjJjvn=eqoh3=Kw@mail.gmail.com
Whole thread Raw
In response to Re: 9.5: UPDATE/DELETE .. ORDER BY .. LIMIT ..  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: 9.5: UPDATE/DELETE .. ORDER BY .. LIMIT ..
List pgsql-hackers
On Tue, May 13, 2014 at 8:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Amit Kapila <amit.kapila16@gmail.com> writes:
>> How about sorting step, are you thinking to have MergeAppend
>> node for it beneath ModifyTable?
>
> Well yeah, that's pretty much the point.

IIUC, the way new design will work is that for new tuple we will now
get tableoid+TID, modified column values as an input (for inheritance
tables we will get this for all child tables as well) for ModifyTable
and get old tuple (which in current case will be provided by MergeAppend
or in general by some scan node) from some node beneath the
ModifyTable.  It then matches the tableoid from old tuple with appropriate
tableoid incase of child tables and then form the new tuple for that
tableoid using old tuple and modified column values.
In this case can we safely assume that we will always get tableoid from
old tuple, ideally it should be there but just not sure and another minor
point is won't we get TID from old tuple (tuple we get from node beneath
ModifyTable), what's the need to pass for new tuple?

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Sergey Muraviov
Date:
Subject: Re: sepgsql: label regression test failed
Next
From: Jeff Janes
Date:
Subject: Re: gettimeofday is at the end of its usefulness?