Relation-valued attributes (again)

From: <jingleheimerschmitt_at_hotmail.com>
Date: 23 Jan 2005 15:01:25 -0800
Message-ID: <1106521285.718120.172410_at_z14g2000cwz.googlegroups.com>



Hello again,

It has been suggested in this newsgroup that relation-valued attributes are unnecessary because anything that can be represented with a relation with RVAs can also be represented using an equivalent
"unnested" form. While I agree with that statement as far as
representing information, I am not convinced that the same is true for expressive power. Let me start by saying that I am clearly out of my league, and if I am missing some important result of relational theory, please let me know. However, I have found a query that I cannot express without RVAs, and would like to know what you're comments are on the scenario:

Given the following table-valued operator:

Op(AID : Integer) : table { Data : String };

and the table:

T { ID : Integer };

I cannot formulate a query (without using RVAs) that would provide the
"join" of the two:

select T "join" Op(ID);

Clearly this formulation is invalid because the right operand must be evaluated in the context of a tuple of the left operand. The query with RVAs is simply:

select T add { Op(ID) RVA } unnest by { RVA };

The result is, at least conceptually, the join of T with the result of invoking Op for each tuple in T.

Obviously, the argument could be made that the information content provided by Op should have been exposed as a relation in the first place, thereby allowing a join in the usual way. But the point is, if the relational algebra is "complete" in some sense, shouldn't I be able to express this seemingly simple query? Or does the introduction of relation-valued operators somehow change the landscape? If relations are orthogonal to types, then why do I need to extend the relational algebra to provide support for this type of query?

Regards,
Bryn Received on Mon Jan 24 2005 - 00:01:25 CET

Original text of this message