It's important to note that if you use Count(field), you should do it on a primary key 
or other required field.  Count will not count fields that are blank.

Kevin

>>> [EMAIL PROTECTED] 07/18/01 08:14AM >>>
Count(fileId) will be faster, but don't take my word for it, run the query
in Query Analyzer and check it out.  The count(*) has to first figure out
what columns it needs to count on, then do the count, the count(fileId) your
telling it which one to count on and it saves time, which on a large table
could be a lot.

-----Original Message-----
From: Michael Lugassy [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 18, 2001 11:38 AM
To: CF-Talk
Subject: OT: COUNT(*)


Which is faster?
COUNT(*) or COUNT(fileID)

assuming fileID is a regular INT, that is also my primary key

Thanks,

Michael
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to