Well, this was just a suggestion to make my queries run fast.  I didn't
quite understand the difference between the two, so I thought I'd ask.

Thanx for clearing that up for me.

Mike Diehl,
Network Monitoring Tool Devl.
Sandia National Laboratories.
(505) 284-3137
[EMAIL PROTECTED]

> -----Original Message-----
> From: Tom Lane [mailto:[EMAIL PROTECTED]]
> Sent: September 20, 2001 12:56 AM
> To: Diehl, Jeffrey
> Cc: 'Haller Christoph'; [EMAIL PROTECTED]
> Subject: Re: [SQL] Out of free buffers... HELP!
> 
> 
> "Diehl, Jeffrey" <[EMAIL PROTECTED]> writes:
> > Ok, can someone explain to me why this first query might 
> run faster than the
> > second?
> > select src,dst,count(dst) from data;
> > select src,dst,count(*) from data;
> 
> Hmm, I'd expect the second to be marginally faster.  count(*) 
> counts the
> number of rows matching the WHERE condition; count(foo) counts the
> number of rows matching the WHERE condition for which foo is not NULL.
> So count(foo) ought to involve a couple extra cycles to test for
> non-NULL-ness of the specified field.  But it's hard to believe you
> could measure the difference --- what results are you getting?
> 
>                       regards, tom lane
> 


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to