BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FindKey v Locate

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Tim
Guest





PostPosted: Mon Feb 16, 2004 11:14 am    Post subject: FindKey v Locate Reply with quote



With a TTable, FindKey and Locate would appear to be interchangeable. Is
their use actually different?


Back to top
Bill Todd (TeamB)
Guest





PostPosted: Mon Feb 16, 2004 12:45 pm    Post subject: Re: FindKey v Locate Reply with quote



It is very difficult to answer database questions when you do not tell
us what database and version you are using.

Assuming Paradox tables, no, they are not the same. FindKey will
always use an index. Locate may not and, therefore, may be very slow
on large datasets.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Back to top
Tim
Guest





PostPosted: Mon Feb 16, 2004 1:11 pm    Post subject: Re: FindKey v Locate Reply with quote




"Bill Todd (TeamB)" <no (AT) no (DOT) com> wrote

Quote:
It is very difficult to answer database questions when you do not tell
us what database and version you are using.

Sorry. I'm using Paradox tables via BDE v 7.0.

Quote:
Assuming Paradox tables, no, they are not the same. FindKey will
always use an index. Locate may not and, therefore, may be very slow
on large datasets.

OK. If the table has no indexes, then presumably FindKey will generate an
error and Locate is the only option. However, Locate will use an index if it
exists, so assuming both methods are as fast as each other on an indexed
field search, there does not appear to be a down side to using Locate
instead of FindKey, plus it has locate options which FindKey does not have.

Anyway, thanks for the reply.



Back to top
Bill Todd (TeamB)
Guest





PostPosted: Mon Feb 16, 2004 10:24 pm    Post subject: Re: FindKey v Locate Reply with quote


On Mon, 16 Feb 2004 13:11:29 -0000, "Tim"
<tim (AT) evolvedatasystems (DOT) co.uk> wrote:

Quote:
Sorry. I'm using Paradox tables via BDE v 7.0.

The latest version of the BDE is 5.2.

Quote:
OK. If the table has no indexes, then presumably FindKey will generate an
error and Locate is the only option. However, Locate will use an index if it
exists, so assuming both methods are as fast as each other on an indexed
field search, there does not appear to be a down side to using Locate
instead of FindKey, plus it has locate options which FindKey does not have.

I have seen many cases where an index is available and Located does
not use it.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.