Logical equivalence of simple and complex types under the relational model?
Date: Mon, 29 Nov 2004 18:39:15 +0100
Message-ID: <cofms4$vr$1_at_news.sap-ag.de>
I have read a number of papers that discuss whether complex data types should be allowed under the relational model.
What I haven't seen analysed is whether there is actually any logical difference (upto renaming/isomorphism) between the resulting models.
It seems to me at first sight that
- RM with simple types
- RM with complex types
are indistiguishable at the logical level.
Naturally in a particular programming language it is possible for them to look different (but not necessary).
I came to this thought by looking at some simple examples. And noting in some relational programming that it appears to be only a question of physical storage allocation whether to use complex types or not.
Consider the following two examples
- Business partner with optional first and last names.
- The common date type example (a complex type) compared to stored day, month and year.
And their alternate physical implementations (or lower level logical implemenations if you prefer to think of this at a lower level of semantics rather than an actual physical level).
1.A. We have an identifier for the person. Person1, and the relations first
name and last name.
i.e. we have the tuples (id: Person1 last-name: "Smith") (id: Person1
firstname: "John")
2.A. We have a person object (complex type). For example Person1. Person one has accessor functions/methods first-name and last-name. However functions are only a special case of relations and so these fucntions are also relations, equivalent to the relations above.
No difference between 1.A and 2.A at the logical level.
1.B We have three fields: day, month, year which may be present in a relation.
2.B. We have a complex type: date. Similar to above we have functions day, month, year. Using these relations for every relation in 1.B we can construct an updatable view that maps to the relation above in 1.B. This construct view behaves exactly the same as the view/relation defined in 1.B above.
Again no difference between 1.B and 2.B at the logical level.
I am guessing that this is true in general.
Rene. Received on Mon Nov 29 2004 - 18:39:15 CET
