> Ok, Justin MacCarthy pointed out something for me to try.  He suggested
> using count(cfid) instead of count(*) which would yield the same results.
> This table has like 944 records btw, here are the results of time in ms
> taken to run 1000 queries of each over 5 tries:
>
> Using count(cfid): 3313
> Using count(*): 3422
>
<cf_snip>
>
> Hmm, the first try came out how I expected, but the other four leaned
> towards count(*).  But really, 100 ms difference over 1000 runs is truly
> insignificant, that is 0.1ms per query on the difference.  So,
> count(*) and
> count(column) is handled the same at least in SQL Server.  If
> anyone has an
> Oracle or other DB server running, I can pass the code along for running
> this test over again.

OK, just to add a point to this - Count(fieldName) counts the non-null
records, while Count(*) will ALWAYS return the count of all records

Count(fieldName) is useful if you want to know how many records have a field
with a value, otherwise it's easier to Count(*) (unless you can guarantee
the record has entries, like an Identity)

Philip Arnold
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.
**********************************************************************


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to