etiquette/rules on posting

  • Thread starter Thread starter DChitwood
  • Start date Start date
John Vinson said:
I don't think they DO use table scans. I haven't got a cite or hard
evidence, but I've used DLookUps on very large tables in circumstances
where they get called once, and get instant response - faster than a
scan could be run. IMO they'll use indexes just as well as a Query.

Sorry then. Was I misinterpreting the following from your previous post?
 
Was I misinterpreting the following from your previous post?

Well... not really. If the criteria for DLookUp (using an index or
not) returns a single record, that record gets returned. If the
criteria return a thousand records, DLookUp still needs to retrieve
only one (the first one that it comes to); DCount() or DMax() or
DMin() must visit every one of the thousand.
 
John Vinson said:
If the criteria for DLookUp (using an index or
not) returns a single record, that record gets returned. If the
criteria return a thousand records, DLookUp still needs to retrieve
only one (the first one that it comes to); DCount() or DMax() or
DMin() must visit every one of the thousand.

Why should they do that? Why wouldn't the DCount function just build a

SELECT COUNT(FieldName) FROM TableName WHERE Criteria

SQL statement, execute it, and return the result? Understand, I haven't
checked to see whether it does or not, but that's what I'd expect it to
do.
 
Back
Top