Re: does a table always need a PK?

From: Lee Fesperman <firstsql_at_ix.netcom.com>
Date: Wed, 03 Sep 2003 01:08:48 GMT
Message-ID: <3F553E89.5AD9_at_ix.netcom.com>


Mikito Harakiri wrote:
>
> "Christopher Browne" <cbbrowne_at_acm.org> wrote in message
> news:bj30il$eoev7$3_at_ID-125932.news.uni-berlin.de..
> > Consider:
> >
> > select count(a + b) from table_t;
> >
> > The nature of the addition there is different from the nature of the
> > COUNT()ing. Perhaps "a + b" should be resolved by reduction of + over
> > a and b. But that's only "perhaps." If the thing inside the
> > aggregate was (a*a - b*b + 25), it is no longer obvious that it is
> > appropriate to recursively use reduction on the components.
>
> Since we can express count via sum, where
>
> select count(a + b) from table_t;
>
> becomes
>
> select sum(1) from table_t;
>
> could I suggest that "count" is redundant operator, so that we can drop it
> from consideration altogether?

You might replace count(*) with sum(1), but count(a + b) only counts tuples where (a+b) is not NULL.

-- 
Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS  (http://www.firstsql.com)
Received on Wed Sep 03 2003 - 03:08:48 CEST

Original text of this message