Board index » delphi » findnearest

findnearest

Greetings:

    If you are using the findnearest function.  How does the function
know which index to use?  Suppose you have 3 indexes on you backend
sql server table.  Is their a way to specify a particular index?

I am asking this question because when I first added this function to
my app, the findnearest function worked rather well (fast).  Now it
seems to have slowed.  Did the extra indexes slow it some how?

                           Thanks in advance....Ed Band

 

Re:findnearest


Quote
Edward Band <edb...@worldnet.att.net> wrote:
>Greetings:

>    If you are using the findnearest function.  How does the function
>know which index to use?  Suppose you have 3 indexes on you backend
>sql server table.  Is their a way to specify a particular index?

No, you cannot, although sometimes, you can give it a hint (I'm
talking Oracle now) which leads to another discussion.

Quote
>I am asking this question because when I first added this function to
>my app, the findnearest function worked rather well (fast).  Now it
>seems to have slowed.  Did the extra indexes slow it some how?

Probably, but not surely, as you have no influence over the SQL-syntax
used by your TTable. If you have SQL monitor, start it to see what
happens. In general, you should use TQueries talking to true SQL
servers, because that leaves you in charge of the correct (and
optimized!) syntax...

Jasper

PS: please take into consideration
- when replying, I just think I know;
- when asking, be sure that I don't.

Other Threads