etiquette/rules on posting

R

Rick Brandt

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?
 
J

John Vinson

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.
 
D

Dirk Goldgar

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top