| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Notions of Type
Marshall wrote:
> erk wrote:
>
>>Marshall wrote: >> >>>Whoops! Doesn't fit the template. The second argument isn't >>>a relation. So, strictly speaking, this is not an algebraic operator, >>>because it isn't closed over the type Relation. >> >>To be pedantic, do operators of type R x R x ... -> R x R x ..., for >>any number of R on either side, fit the algebra of R? Or is there some >>cardinality "constraint"?
>>>Exercise for the >>>reader: what *is* the type of the other argument? This should >>>make your head hurt a least a little bit. >> >>Maybe I'm off-base, but isn't the type of the second argument a subset >>of the heading of the relation?
Not all that nasty when one considers that most relational proponents would demand a dbms have a system catalog that has all of those things. Most (all?) would also insist the dbms properly perform schema changes in reaction to assignments to the system catalog.
> I think it's quite reasonable to investigate the idea of
> types as values. But I think it would be bad if our
> motivation for doing so was because we needed to
> go through various convolutions just to write the type
> rules for our basic algebra. Much better to start with
> a clean algebra and investigate from there.
I agree. My suggestion for the operand to project was clearly inferior to the others.
>>So if RELATION is a type generator, the >>second argument is a type parameterized by the actual type of the >>relation parameter.
Why introduce asymmetry? Why not S: Relation(A INTERSECT P) ?
Or perhaps better:
Given sets of attributes A and B
A : {name: AttributeName, type: Type} and a relation R of type Relation(A)
R : Relation(A)
B : {name: AttributeName, type: Type}
and a relation P of type Relation(B)
P : Relation(B)
PROJECT takes two operands, R and P, and returns
a relation S
S : Relation(A INTERSECT B)
If the operation is really union, the language might differentiate PROJECT syntactically with a different operator from UNION and semantically with a constraint that {} = (B MINUS A).
I don't think it's the same as
> the type of A; that overspecifies things, because we don't
> need a type attribute in P. We really only need the name
> column.
There is that, but even still, the familiar project syntax could be just a short-hand for 'name x same type as...'.
So now to write the definition of PROJECT, we need
> some operator ... hmmm ... we need an operator that can take
> a relation of a given set of attributes and return us another
> relation like that, but with fewer ... uh oh; now we're in
> trouble.
>
>
>>There are various sense of type parameterization >>here, and I'm not smart enough right now to find their proper names. >>Does some type jockey care to rescue us?
>>>Note that the type Relation is a what Date et al call a "type >>>generator" >>>and others call a parameterized type. >> >>Are these one and the same?
>>>[...] I think we've all intuited, loosely >>>speaking, that there's a real algebra in there trying to get out. >> >>I think for purposes of the relational model we all know and love >>(especially its useful operators), a real algebra won't suffice. Or am >>I just being short-sighted?
One of these days I will have to take the time to understand it better. Received on Fri Aug 18 2006 - 08:44:56 CDT
![]() |
![]() |