![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Leandro Guimarães Faria Corsetti Dutra <lgcdutra (AT) terra (DOT) com.br> wrote: On Mon, 25 Aug 2003 11:57:09 -0700, Mikito Harakiri wrote: The examples of (still) open research topics include view updates Nice of you to ignore the nicest view updateability model proposed by D&D... Do you mean by Date & McGoveran? I believe I have found some problems on it. Is anybody here interested in hearing about that? |
#2
| |||
| |||
|
|
Yes - what is your concern? |
|
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. |
#3
| ||||
| ||||
|
|
Jonathan Leffler <jleffler (AT) earthlink (DOT) net> wrote 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 :-) |
#4
| ||||
| ||||
|
|
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? Symmetry. |
|
No reasons are given. If you insert the relation in only in one relvar the view is updated correctly. And if you insert the tuple(s) in both relvars, the view is also 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. And this is any less arbitrary? |
|
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 :-) If you do not declare all of your constraints to the dbms, the dbms cannot enforce them. |
#5
| |||||||||
| |||||||||
|
|
"Bob Badour" <bbadour (AT) golden (DOT) net> wrote 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? Symmetry. Symmetry is a principle of beauty, but not a principle of logic :-) |
|
No reasons are given. If you insert the relation in only in one relvar the view is updated correctly. And if you insert the tuple(s) in both relvars, the view is also updated correctly. Of course, but the DBMS does not have enough information in order to decide which is the true solution. |
|
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. And this is any less arbitrary? Yes, it is. If a problem is undecidable it is better to say "the problem is undecidable" rather than inventing a possible false result without any warning. |
|
It is even clearer with project views; var x real relvar { a Integer, b Integer} key { a, b }; var vx virtual x { b }; insert into vx relation { tuple { b 1 } }; We can deduce infinite possible solutions. Which solution should we choose? All? |
|
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 :-) If you do not declare all of your constraints to the dbms, the dbms cannot enforce them. I declared all my constraints, but probably the example was not very good. |
|
Imagine another example: You have two relvars Fat and Tall, with this type: relation { Name Char } Relvar Fat holds the relation of people we know they are fat and relvar Tall holds the relation of people we know they are tall. You don't know if they are views or base relvars. We create a view: FatOrTall virtual Fat union Tall; Imagine that a guy called Quixote is thin and tall, and a guy called Sancho Panza is fat and short. We try to insert a relation: insert FatOrTall relation { tuple { Name 'Quixote' }, tuple { Name 'Sancho Panza' } }; This operation means: Quixote and Sancho Panza are fat or tall. This is a true proposition. If we use the D&McG approach we would deduce that Quixote and Sancho Panza are fat AND tall, what is a false proposition. |
|
If you make this query: Fat where Name = 'Quixote'; The DBMS will lie to you saying that Quixote is fat. Is this reasonible? |
|
The POOD was created in order to elude problems like this, but it is only a patch. If the POOD falls, the D&McG view updating approach falls with it. |
|
Although this is an easy to solve flaw. |
#6
| |||
| |||
|
|
"Alfredo Novoa" <alfredo (AT) ncs (DOT) es> wrote in message news:e4330f45.0309080357.3a627b52 (AT) posting (DOT) google.com... Of course, but the DBMS does not have enough information in order to decide which is the true solution. If it inserts the tuple into only one relvar, it must decide which. If it inserts the tuple into both relvars, it eliminates an arbitrary decision while preserving important mathematical properties. |
|
Yes, it is. If a problem is undecidable it is better to say "the problem is undecidable" rather than inventing a possible false result without any warning. It is not undecidable. The only way it can create a false result without warning is if the designer omitted an important integrity constraint. If the designer completes his job, the problem goes away. See principle #4 at: http://www.dbdebunk.com/page/page/622150.htm |
|
It is even clearer with project views; var x real relvar { a Integer, b Integer} key { a, b }; var vx virtual x { b }; insert into vx relation { tuple { b 1 } }; We can deduce infinite possible solutions. Which solution should we choose? All? |
#7
| ||||
| ||||
|
|
"Bob Badour" <bbadour (AT) golden (DOT) net> wrote in message news:Ia07b.686$wf7.65737782 (AT) mantis (DOT) golden.net... "Alfredo Novoa" <alfredo (AT) ncs (DOT) es> wrote in message news:e4330f45.0309080357.3a627b52 (AT) posting (DOT) google.com... Of course, but the DBMS does not have enough information in order to decide which is the true solution. If it inserts the tuple into only one relvar, it must decide which. If it inserts the tuple into both relvars, it eliminates an arbitrary decision while preserving important mathematical properties. In language of view equations that translates into an equation Ax=b having more than one solution. |
|
Yes, it is. If a problem is undecidable it is better to say "the problem is undecidable" rather than inventing a possible false result without any warning. It is not undecidable. The only way it can create a false result without warning is if the designer omitted an important integrity constraint. If the designer completes his job, the problem goes away. See principle #4 at: http://www.dbdebunk.com/page/page/622150.htm There is a clear method of making equation solution unique: add more equations! |
|
It is even clearer with project views; var x real relvar { a Integer, b Integer} key { a, b }; var vx virtual x { b }; insert into vx relation { tuple { b 1 } }; We can deduce infinite possible solutions. Which solution should we choose? All? Given table X ( a integer, b integer ) the view view A as select a from X is not updateable, since the equation Ax=y has nonunique solution no matter what value relation y has. If we throw in more equations, for example view A1 as select b from X then, the view that combines A and A1 together is updateable. Constraints are views that evaluate to constants, they could be added to disambiguate the original view the same way as the "normal" views. |
|
All these ideas are parallel to equations solving in algebra. Given 2 variables x1 and x2, the equation x1 = y1 doesn't have unique solution since x2 can be chosen arbitrarily. However, if we add x2 = y2 then our system of equation has unique solution (no matter what values variables y1 and y2 have). Alternatively, we can add a constraint x2 = 0 which disambiguates our system of equations as well. |
#8
| |||||
| |||||
|
|
"Mikito Harakiri" <mikharakiri (AT) ywho (DOT) com> wrote in message news:Uj47b.22$741.237 (AT) news (DOT) oracle.com... In language of view equations that translates into an equation Ax=b having more than one solution. I am not certain what you mean. Are you saying that in the case of ignoring symmetry and arbitrarily deciding to insert to only one base relvar there is more than one solution? |
|
Or are you comparing the entire situation to an equation with multiple roots? |
|
There is a clear method of making equation solution unique: add more equations! I assume you are agreeing with my suggestion to declare the constraints. |
|
Given table X ( a integer, b integer ) the view view A as select a from X is not updateable, since the equation Ax=y has nonunique solution no matter what value relation y has. If we throw in more equations, for example view A1 as select b from X then, the view that combines A and A1 together is updateable. Constraints are views that evaluate to constants, they could be added to disambiguate the original view the same way as the "normal" views. Suppose we extend the syntax for view definition to allow systematic default values: view A as select a from X default X set b = 0 on insert to A |
|
All these ideas are parallel to equations solving in algebra. Given 2 variables x1 and x2, the equation x1 = y1 doesn't have unique solution since x2 can be chosen arbitrarily. However, if we add x2 = y2 then our system of equation has unique solution (no matter what values variables y1 and y2 have). Alternatively, we can add a constraint x2 = 0 which disambiguates our system of equations as well. The constraint method basically restates POOD. Or alternatively, POOD states a good design has sufficient constraints declared to disambiguate the systems of equations. The default value method constrains specific operations without constraining the base relvars. |
#9
| |||
| |||
|
|
"Bob Badour" <bbadour (AT) golden (DOT) net> wrote in message news:Vd97b.717$zB.69216404 (AT) mantis (DOT) golden.net... Suppose we extend the syntax for view definition to allow systematic default values: view A as select a from X default X set b = 0 on insert to A |
#10
| |||
| |||
|
|
3. Constraints are views that evaluate to constants. For example, if we define view V3 select max(sal) from ( select sal from emp union select 1000 from DEE ) then constraint "each emp has salary no more than 1000" can algebraically be written as V3*x = 1000 where "V3*x" means view V3 applied to a set of base relations x, and "1000" means an output relation that has one tuple with a single value 1000. |
![]() |
| Thread Tools | |
| Display Modes | |
| |