MLH <CR**@NorthState.net> wrote in
news:i5********************************@4ax.com:
I have a table I can open as table type
recordset or a dynaset. Searching for
a particular value in the table's main
keyfield, which would be faster and
less strain on the application...
FindFirst method - or - Seek method?
Take 5 minutes and test it both ways in your environment with your
data structure.
My money is on Seek.
Let us know how you fare.
You were right, Tom. I had to get a table that was NOT attached
to test it on. I got one that had about 160k recs in it. Seek was
quicker. Thx
If you're opening an entire table (which is required for SEEK),
then, yes, SEEK will be faster than .FindFirst on the entire table.
But if you return only the records you are looking for (using
WHERE), you may not even *need* the .FindFirst, and even if you want
to return multiple records and touch each one of them, .FindFirst
navigation within a very small group of records may be faster than a
SEEK because of the added overhead of retrieving more records
required by the SEEK.
SEEK is really only valuable if you have a large table that you
continually need to refer to and you need to jump around in that
table a lot. There are scenarios where this is definitely the case.
But it's limited to recordsets that include only a single table. so
if you have any joins, forget it.
In short, the apparent massive performance advantage of SEEK
disappears in almost all real-world scenarios.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc