Re: relations aren't types?

From: Bob Badour <bbadour_at_golden.net>
Date: Sun, 11 Jan 2004 13:51:27 -0500
Message-ID: <UOadnSvOztHMBpzdRVn-jA_at_golden.net>


"Marshall Spight" <mspight_at_dnai.com> wrote in message news:SHYLb.16240$8H.41065_at_attbi_s03...
> "John Jacob" <jingleheimerschmitt_at_hotmail.com> wrote in message
news:72f08f6c.0401092141.534eb6a1_at_posting.google.com...
> >
> > For me, the simplest explanation (the one where I finally understood
> > the difference) is that if the type specifier describes the structure
> > of values of the type, that is logical structure. A relation type
> > specifier exposes the attributes of relation values of that type
> > (relation { ID : Integer }). An array type specifier exposes the type
> > of the elements that values of that type contain (array[Integer]). A
> > scalar type specifier is simply the name of the type in question, like
> > Integer, Degree, Coordinate, etc. By looking at a scalar type
> > specifier, the user cannot determine any logical structure for values
> > of that type.
>
> I would like to ask for a bit of clarification on that. I believe I follow
> what you're saying, up until you list some specific scalar types.
> "Integer, Degree, Coordinate..." I follow how integer has no
> logical structure. But the other types you name sound more like
> user-defined types to me; was that you intent? I can imagine a type
> Coordinate with two components, x:int and y:int, (as well as
> associated methods.) That looks like logical structure to me.
>
> To my mind, the types without logical structure are typically
> those that are system-defined primitives, typically something
> like: int, float, char, byte, boolean, and probably not many
> more beyond that. What is your thinking?

Marshall,

Even the coordinate type describes a single value, and it has multiple possible representations for that value. One of those possible representations has the two components you mention. Another has a radius and an angle.

In the relational model, (x,y) and (r, phi) are not structural components but logical operations on the value. Thus, a character string may have a length operation, and at the physical level, the dbms may or may not store the length.

In the relational model, values have no structure but only operations.

When the values are converted to an external physical representation, some of the operations will appear like structural components by becoming structural components in the external physical representation.

Thus, it does not matter to the casual user whether the dbms stores coordinates as cartesians or as polar coordinates; the user can use either as an external representation.

The only logical structure used by relational operations is the structure of tuples and of relations. The logical structure used by array operations is the structure of arrays and possibly of tuples too.

When it comes right down to it, the attributes of a relation or of a tuple are defined just as operationally as the attributes of any other type.

Thus, I see no use in distinguishing between scalar vs. non-scalar types. What is non-scalar to a relation is scalar to an array, and vice versa.

It is important that all global variables are relvars. The difference between a specific type and a generic type is important, or it is at least very interesting. Received on Sun Jan 11 2004 - 19:51:27 CET

Original text of this message