db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Lichtman <swa...@rcn.com>
Subject Re: Fwd: COUNT queries
Date Thu, 10 Nov 2005 19:14:13 GMT

> > If you want to get the count including nulls, you can use COUNT(*),
> > which returns the number of rows in the set being aggregated (not the
> > number of values).
>A side question:  Is this any faster than using COUNT( colName)?  Or
>does COUNT() always entail something on the order of iterating through
>all the results of the query?

The performance is the same. The only difference is that 
COUNT(colName) looks at values and discards nulls, and COUNT(*) 
doesn't look at values as it iterates through the data.

                        -        Jeff Lichtman
                                 Check out Swazoo Koolak's Web Jukebox at

View raw message