db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Fwd: COUNT queries
Date Thu, 10 Nov 2005 16:55:11 GMT
Hi Lars,

count(*) iterates through the rows. I don't think it's any faster than 
count( colName ).

-Rick

Lars Clausen wrote:

>On Thu, 2005-11-10 at 04:41, Jeffrey Lichtman wrote:
>  
>
>>>1) A null column is excluded from a COUNT( colName ) aggregate. This 
>>>is described in the section 10.9 under General Rules 4a. The 
>>>database is supposed to raise a warning: "warning--null value 
>>>eliminated in set function"
>>>      
>>>
>>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?
>
>-Lars
>
>  
>


Mime
View raw message