Re: Bags versus sets; are they needed?

From: Mikito Harakiri <mikharakiri_at_yahoo.com>
Date: 3 Apr 2002 22:03:49 -0800
Message-ID: <bdf69bdf.0204032203.663648d8_at_posting.google.com>


pkl_at_mailme.dk (Peter Koch Larsen) wrote in message news:<61c84197.0204030442.7f8da4ba_at_posting.google.com>...
> mikharakiri_at_yahoo.com (Mikito Harakiri) wrote in message news:<bdf69bdf.0204021828.89945a6_at_posting.google.com>...
> > Aggregation and projection commute on bags, but don't on sets. Given
> > that aggregation has been added to relational theory as an
> > afterthought, purists don't think that aggregation is significant
> > enough to cast a doubt on sets.
> Aggregation was part of Codds original language, if i do not remember
> incorrectly.

Abiteboul&Hull&Vianu p.97 mentions 1982 paper by Klug as the first one.  

> That projections commute bags but not on sets is not a
> reason for bags in itself, is it?

Here is one more reason to be unhappy about sets. Rows and columns could be considered as dual "entities". This symmetry is not perfect, of course, slightly "broken" by the fact that normally the number of rows is far exceeding the number of columns. Ignoring this

"extensional" difference between rows and columns, there is an
"intensional" one: with sets the constraint is put on rows, while
there is no "dual" constraint on columns. For example:

A B
- -
1 1
2 2

is a perfectly legal relation from rows perspective, while it violates no-duplicate constraint on columns.

The row and column duality naturally translates into duality of projection and selection operations. With sets, those are not quite dual. Indeed, the #of columns is an invariant of selection operation, while the #of rows is not an invariant of projection. (Loosely speaking, we need to apply selection as a possible sideffect of projection in order to remove duplicates). Received on Thu Apr 04 2002 - 08:03:49 CEST

Original text of this message