"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 4: Don't 'kill -9' the postmaster

Reply via email to