![]() | |
#61
| ||||
| ||||
|
|
Lauri, thank you! We get input to this discussion from a person who really knows practical database applications. "Lauri Pietarinen" <lauri.pietarinen (AT) atbusiness (DOT) com> kirjoitti viestissä news:bire7g$md8$1 (AT) nyytiset (DOT) pp.htv.fi... Take the standard S, SP and P -tables. I want to hide the joins from the user so I create a view: CREATE VIEW V_S_SP_P ( S#, SNAME, QTY, P#, PNAME) AS SELECT S.S#, S.SNAME, SP.QTY, P.P#, P.PNAME FROM S, SP, P WHERE S.S# = SP.S# AND SP.P# = P.P#; |
|
Hmm... there is at least one additional reason not to provide such a view to programmers. Since it is denormalized, they might try to update the attributes of a supplier for just one row, receiving an obscure error message about the non-updateteability of the view. Or, they could try to insert into the view. Another reason is that it is not an outer join. There may be parts which currently have no supplier. Users might be misled to thinking that the above query gives all parts, not just the parts supplied by somebody. Of course, these are well-known problems of a denormalized database. OK, that's a fair criticisim. I'll give you a better example at a later |
|
2) worry about bad performance So they end up coding the joins and exists themselves. My (non scientific) claim is that because users and DBMS-builders are used to thinking in terms of (SQL-)bags, they don't even come to consider (e.g.) the usefulnes of hiding complexity in views, at least not to the extent that it is possible. [snip] |
|
I do not see how a mathematical relation language would make the optimization procedure above easier than a multiset language. This is a typical example of determining the join order of tables in a nested loop join. Looks like it makes no difference in the optimization procedure whether the user formulates his query in a multiset language or a mathematical relation language. That has been my impression since studying this a bit a couple of years ago. Chris Date and some others claim the opposite, but they should provide practical evidence. I think one has to take into consideration the commercial and |
#62
| |||
| |||
|
|
"Christopher Browne" <cbbrowne (AT) acm (DOT) org> wrote in message news:bil8gl$anhtd$1 (AT) ID-125932 (DOT) news.uni-berlin.de... [snip] "Christianity has not been tried and found wanting; it has been found difficult and not tried." -- G.K. Chesterton The problem with the relational model is that it has never been found difficult. It has been assumed difficult and not tried. |
#63
| |||
| |||
|
|
"Bob Badour" <bbadour (AT) golden (DOT) net> wrote in message news:U9r3b.72$Br4.10705055 (AT) mantis (DOT) golden.net... "Christopher Browne" <cbbrowne (AT) acm (DOT) org> wrote in message news:bil8gl$anhtd$1 (AT) ID-125932 (DOT) news.uni-berlin.de... [snip] "Christianity has not been tried and found wanting; it has been found difficult and not tried." -- G.K. Chesterton The problem with the relational model is that it has never been found difficult. It has been assumed difficult and not tried. I would say that it was assumed difficult when System R was built. Oracle had to copy the IBM standard to be commercially viable and the rest is history; i.e. we are locked in (albeit only weakly) to SQL. Actually, it possibly *was* difficult back in those days with the limited CPU and memory available. |
#64
| ||||||||
| ||||||||
|
|
"Bob Badour" <bbadour (AT) golden (DOT) net> wrote in message news:62g3b.53$Zb3.7844959 (AT) mantis (DOT) golden.net... I find it interesting that you chose the example you chose. Ironically, the example clearly demonstrates how D&D's proposed type system helps with view updatability. Obviously, the type system must have some efficient method to convert from each declared possible representation to the supported physical representations and vice versa. If one considers Point with both polar and cartesian possible representations, then the problem you mention above simply disappears. I find it interesting that you are bringing up the types. IMO, this example demonstrates that type system is overrated. What is the benefit having a base type Point and two descendants CartesianPoint and PolarPoint? |
|
OK, we can clearly have a Point column used in some other relation, for example Circle: table Circle ( center Point, radius Number ) Therefore, some tuples would have CartesianPoint while the others PolarPoint implementation - that's the idea, right? |
|
I disagree. |
|
When quering how many circle center points are positioned in vicinity of some point, for example, we would like to know Polar coordinates for all the tuples, no matter what internal representations they have. |
|
Likewise, it would be convenient to manipulate Cartesian representation exclusively in some other queries. |
|
Both queries could be answered if we have 2 views CartesianPointCircleCenter and PolarPointCircleCenter and just a single representation for the Point. |
|
I can't possibly see the benefit of having heterogeneous list of Points in the database design. |
|
Returning to your idea that type system eliminates view update problem I fail to see that too. If you are implying that Point would have "getter "methods returning both Cartesian and Polar coordinates in it, then it's essentially a procedural implementation of inverse view inside a type. Not to mention that "fat" types are disgusting, as every time you introduce new subtype you have to add more methods inside base type definition. |
#65
| ||||
| ||||
|
|
"Mikito Harakiri" <mikharakiri (AT) ywho (DOT) com> wrote When quering how many circle center points are positioned in vicinity of some point, for example, we would like to know Polar coordinates for all the tuples, no matter what internal representations they have. The type system in TTM allows (even encourages) this. The DBA might specify a polar physical representation, but this doesn't matter because the dbms can derive the desired representation from any physical representation. |
|
Both queries could be answered if we have 2 views CartesianPointCircleCenter and PolarPointCircleCenter and just a single representation for the Point. This is a straw man. You have already remarked on the updatability problem this causes and that the type system in TTM solves. |
|
I can't possibly see the benefit of having heterogeneous list of Points in the database design. At the logical level, there is no heterogeneous list. Whether it is heterogeneous at the physical level is irrelevant to expressibility and affects only performance. |
|
I am not implying anything that isn't stated explicitly in TTM. There are no "getter" or "setter" methods in TTM. Getting and setting focuses on the physical location of variables and not on the logical meaning of values. |
#66
| ||||
| ||||
|
|
"Bob Badour" <bbadour (AT) golden (DOT) net> wrote in message news:cd3b3cf.0309030652.27cfaff1 (AT) posting (DOT) google.com... "Mikito Harakiri" <mikharakiri (AT) ywho (DOT) com> wrote in message news:<irr3b.16$D94.166 (AT) news (DOT) oracle.com>... When quering how many circle center points are positioned in vicinity of some point, for example, we would like to know Polar coordinates for all the tuples, no matter what internal representations they have. The type system in TTM allows (even encourages) this. The DBA might specify a polar physical representation, but this doesn't matter because the dbms can derive the desired representation from any physical representation. How DBMS would derive the desired representation? Is TYPE POINT POSSREP XY_POINT { X NUMERIC, Y NUMERIC } POSSREP POLAR_POINT { A NUMERIC, R NUMERIC } a valid syntax? Now POINT P := XY_POINT (1,1) NUMERIC ANGLE := THE_A(P) would the last operation succeed or throw an exception? In other words, when specifying N possreps for a type is DBA also required to write doen N*(N-1) conversion operators? |
|
Both queries could be answered if we have 2 views CartesianPointCircleCenter and PolarPointCircleCenter and just a single representation for the Point. This is a straw man. You have already remarked on the updatability problem this causes and that the type system in TTM solves. Once again, if manually programmed conversion operators are part of TTM, |
|
then the TTM possrep conversion idea is similar to "on update" trigger where DBA must code view updates. |
|
I can't possibly see the benefit of having heterogeneous list of Points in the database design. At the logical level, there is no heterogeneous list. Whether it is heterogeneous at the physical level is irrelevant to expressibility and affects only performance. OK. I am not implying anything that isn't stated explicitly in TTM. There are no "getter" or "setter" methods in TTM. Getting and setting focuses on the physical location of variables and not on the logical meaning of values. Question. Are observer methods on logical or physical level? |
#67
| |||
| |||
|
|
Once again, predicate calculus and set theory are just 2 tiny subjects in math. You are not implying that the all the rest of the math is irrelevant, aren't you? |
#68
| |||
| |||
|
|
the TTM possrep conversion idea is similar to "on update" trigger where DBA must code view updates. |
#69
| |||
| |||
|
|
In other words, when specifying N possreps for a type is DBA also required to write doen N*(N-1) conversion operators? |
![]() |
| Thread Tools | |
| Display Modes | |
| |