> Which is faster?
> COUNT(*) or COUNT(fileID)
>
> assuming fileID is a regular INT, that is also my primary key
First, you have to understand that they do different things;
Count(*) returns the number of rows (total) in the table
Count(fileID) returns the number of non-NULL entries in that field
Specifying the field name slows it down as it has to see if there are
any
NULL entries - even though YOU know there won't be any, it has to
make sure
there aren't
I'm assuming SQL Server with this response...
Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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