Re: MERGE as the imperative form of aggregation
Date: 16 Apr 2007 13:49:08 -0700
Message-ID: <1176756548.180869.284790_at_n76g2000hsh.googlegroups.com>
On Apr 16, 10:24 am, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> Marshall wrote:
>
> > So that's what got me to thinking about trying to make a
> > closer correspondence between the imperative and algebraic
> > operators. I have to say I find the idea appealing.
>
> If one has assignment and if one has the algebraic operators, what does
> one lack?
One lacks imperative statement(s) that are efficiently implementable
in a distributed context. Ordinarily that wouldn't bother me much,
but the severity of this issue makes me want to include finer grained
imperative operators in the model.
For example, suppose I want to insert one row into a table with
a million rows. Assume the below executes on a client machine,
and the relvar T is on a distinct server machine.
or
Introducing context sensitivities into expression evaluation rules
is a bad idea. In the above, the context-free evaluation of (1)
will transfer one million rows from server to client, and one
million and one rows from client to server. The context-free
evaluation of (2) will transfer one row from client to server.
T = T union row (1)
insert T row (2)
> >>Next, there are insert, update, and delete triggers. Now merge is
> >>expected to be combination of insert, update; naturally insert and
> >>update triggers are expected to be fired when issuing a merge
> >>statement?
>
> > Triggers, sigh. I have a poor grasp of what they are for and
> > what they mean from a theoretical standpoint. What are they
> > necessary for?
>
> Very little. Something like them may be required to resolve
> ambiguity in view updates.
> > I have seen good descriptions of how to
> > express view updating as triggers that model the inverse
> > view, but would that be necessary if we had full view updating
> > in the engine?
>
> I suppose that depends on what you mean by "full view updating". It
> strikes me that some view updates are ambiguous. How does "full view
> updating" resolve the ambiguity?
> > What are triggers necessary for? I am clear
> > on the value of *notification* of changes being sent to other
> > components, but *actions* are less clear to me. Especially
> > "instead of" actions.
>
> Triggers can automate the correct method for preserving invariants under
> certain transformations. For example, one may decide to present some
> group of users with an interface that allows them to simply delete any
> invoice from their view regardless of the constraints and even without
> deleting any tuples in base relations.