Re: Counting propositions
Date: Tue, 22 Jun 2004 17:06:53 +0300
Message-ID: <40d83c0d_at_post.usenet.com>
- Post for FREE via your newsreader at post.usenet.com ****
"Paul" <paul_at_test.com> wrote in message
news:CFWBc.19053$NK4.3265189_at_stones.force9.net...
> x wrote:
> > If there is something like count(distinct *) , it count "propositions"
> > No matter how you modify the relation, it count "propositions"
> > If you use count(distinct a,b,c) you count distinct (a,b,c) tuples no
matter
> > how you modify the relation (if a,b,c remains unaltered).
> For example say you have a relation that has one row per invoice and you
> use count(*) to count the invoices. Then you change your design to allow
> multiple invoice lines per invoice, so you add an extra column to the
> primary key. Now your "select count(*)" query will return incorrect
> results, but "select count(invnum)" will still be correct.
This is the point. You wanted to count invoices, you counted invoices.
> I guess if you add a column to a relation it may change the whole
> meaning and granularity of the underlying predicate, or it may just add
> an extra bit of information but leave the basic meaning of the predicate
> intact. So I think "select count(*)" could be a dangerous shortcut in
> the same way that "select *" is.
> So the point you make above could be seen as an advantage just as much
> as a disadvantage.
It seems count(*) is really count(row_id). How count(*) could be an advantage if one principle of Relational Model is "make all data explicit" ? :-)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Usenet.com - The #1 Usenet Newsgroup Service on The Planet! *** http://www.usenet.com Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=