Re: merge command - GSoC progress

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Boxuan Zhai <bxzhai2010(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: merge command - GSoC progress
Date: 2010-08-04 12:23:36
Message-ID: 4C595BC8.1040101@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/08/10 12:23, Boxuan Zhai wrote:
> I am just considering that there may be some logical mistakes for my rule
> rewriting strategy of MERGE actions.
>
> In my current design, if we find that an action type, say UPDATE, is
> replaced by INSTEAD rules, we will remove all the actions of this type from
> the MERGE command, as if they are not be specified by user from the
> beginning. See the test example in my pages for this situation.
> https://wiki.postgresql.org/wiki/MergeTestExamples#With_INSTEAD_rules
>
> Now,I am thinking that maybe we should keep the replaced actions in action
> list, and just mark them to be "invalid". If one join tuple from the main
> plan fits the condition of this action, we will do nothing on it.
>
> This strategy is a little bit different with the current one. If we delete
> an action, the tuples that meet it condition will be caught by other
> actions. If we keep it, the tuples that match it will be skipped.
>
> I think the new design is more logical, and I wonder your opinion on this
> problem.

So if I understood correctly, in the instead rule example you have at
the wiki page, the stock table should contain one row, with the same
balance it had before running the MERGE? Yeah, agreed, that's much more
logical.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-04 12:53:15 Re: review: psql: edit function, show function commands patch
Previous Message Marko Tiikkaja 2010-08-04 12:22:54 Re: Proposal / proof of concept: Triggers on VIEWs