Your search criteria should always match the index, if you want the best
performance.

John

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Sytze de Boer
Sent: Wednesday, February 09, 2011 1:21 PM
To: profox
Subject: Re: VFP9 - Speed

Hello folk
This has been really helpful

Please may I indulge you once more
Should the select be:

Select * From winhst Where UPPER(serno)=trcask Order By invnum Into Table
(myfile)
or
Select * From winhst Where trcask=UPPER(serno) Order By invnum Into Table
(myfile)


S





On Thu, Feb 10, 2011 at 8:09 AM, Richard Kaye <[email protected]> wrote:

> To be optimized, your WHERE clause expression needs to match an index 
> expression.
>
> trcask =UPPER( the search expression)
> Select * From winhst Where UPPER(serno)=trcask Order By invnum Into 
> Table
> (myfile)
>
> See Using Rushmore Query Optimization to Speed Data Access in the VFP
help.
>
> --
> rk
>
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]]
> On Behalf Of Sytze de Boer
> Sent: Wednesday, February 09, 2011 2:00 PM
> To: [email protected]
> Subject: VFP9 - Speed
>
> Hi foxers
>
> I have a table called WINHST
> This table has 10 indexes
> The 7th index is on a field called SERNO. Expression is upper(serno)
>
> trcask = the search expression
> Select * From winhst Where serno=trcask Order By invnum Into Table 
> (myfile)
>
> Question 1
> In order to speed the search, should I do the following?
> sele winhst
> set order to 7
> Select * From winhst Where serno=trcask Order By invnum Into Table 
> (myfile)
>
>
> Question 2
> Does the "order by" clause slow down the select issue ?
>
>
> --
> Regards
> Sytze de Boer
> Kiss Systems
>
>
> --- StripMime Report -- processed MIME parts --- multipart/alternative  
> text/plain (text body -- kept)  text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to