Path: news.easynews.com!easynews!newsfeed.frii.com!out.nntp.be!propagator-SanJose!in.nntp.be!nntp-relay.ihug.net!ihug.co.nz!logbridge.uoregon.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: mikharakiri@yahoo.com (Mikito Harakiri)
Newsgroups: comp.databases.theory
Subject: Re: Bags versus sets; are they needed?
Date: 3 Apr 2002 22:03:49 -0800
Organization: http://groups.google.com/
Lines: 37
Message-ID: <bdf69bdf.0204032203.663648d8@posting.google.com>
References: <61c84197.0204020335.5aa9c00f@posting.google.com> <bdf69bdf.0204021828.89945a6@posting.google.com> <61c84197.0204030442.7f8da4ba@posting.google.com>
NNTP-Posting-Host: 12.236.17.145
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1017900229 19909 127.0.0.1 (4 Apr 2002 06:03:49 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 4 Apr 2002 06:03:49 GMT
Xref: easynews comp.databases.theory:20355
X-Received-Date: Wed, 03 Apr 2002 23:01:42 MST (news.easynews.com)

pkl@mailme.dk (Peter Koch Larsen) wrote in message news:<61c84197.0204030442.7f8da4ba@posting.google.com>...
> mikharakiri@yahoo.com (Mikito Harakiri) wrote in message news:<bdf69bdf.0204021828.89945a6@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).
