Re: Possible problems with Date & McGoveran View Updating

From: Alfredo Novoa <alfredo_at_ncs.es>
Date: 7 Sep 2003 11:59:20 -0700
Message-ID: <e4330f45.0309071059.7a7897e1_at_posting.google.com>


Jonathan Leffler <jleffler_at_earthlink.net> wrote in message news:<o894b.2393$Lk5.1358_at_newsread3.news.pas.earthlink.net>...

> Yes - what is your concern?

Sorry for the delay. I am trying to clean my ideas, and it is more complex than I expected. I will keep you informed.

> My primary concern is the rules for difference views; specifically,
> the part that says that the row to be inserted cannot satisfy the
> predicate for B in V = (A MINUS B). Suppose a row is presented for
> insertion into V that does not appear in either A or B at the moment,
> but could be valid in either. Does that mean that it is impossible to
> insert the row into the view? If the CJD and DMcG rules are as I
> understand them, I think the answer is "yes, it is impossible to
> insert into the view". I think I want the answer to be "no, you can
> insert the row because it satisfies the predicate for A (so it will
> show up in the view) and because it does not actually appear in B (so
> it won't cancel the appearance of the row in V)". This is a less
> stringent criterion than insisting that the row cannot appear in B.

I agree with you, it is one of the problems I found.

Another is:

You want to insert a relation in V = A union B and the relation value satisfies P(A) and P(B). D&McG rules say: yes the relation must be insterted in both relvars, but why in both? No reasons are given. If you insert the relation in only in one relvar the view is updated correctly. It seems an arbitrary rule to me, and it causes strange behaviours that they tried to fix with the now dropped Principle of Orthogonal Design. In my opinion the correct result is: the update is invalid because there is not a unique solution, the insert proposition is ambiguous.

Eg:

var Dead real relvar { Name Char } key { Name }; var Missing SameTypeAs( Dead ) key { Name }; var DeadOrMissing virtual Dead union Missing;

insert DeadOrMissing relation { tuple { Name ‘John Doe' } };

The DBMS can not deduce if Doe is dead, missing or both, therefore the update must be rejected.

Imagine we drop the POOD and we follow D&McG rules. The DBMS would deduce that Doe is dead and missing, what is clearly an absurd specially if Doe is found alive later :-)

Another problem is: they say that a view insert always map to inserts on the base but in the case of difference views a deletion in the B relvar cause a view insert if the row is also in A.

var x real relation { a integer } key { a }; var y SameTypeAs( x ) key { a };
var z virtual x minus y;
x := relation { tuple { a 1 } },
y := x;

insert into z relation { tuple { a 1 } };

This should be mapped to:

delete y where a = 1;

I will post my alternative approach when I finish it.

Regards
  Alfredo Received on Sun Sep 07 2003 - 20:59:20 CEST

Original text of this message