Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting X TOP records
Message
From
11/10/2004 12:58:56
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00950435
Message ID:
00950474
Views:
15
>Am I correct in assuming that when you use SQL Select, the TOP syntax is not optimized for an index?
>
>I have a table MYORDERS with field ORDERNO that has index tag.
>
>When I try:
>
>
>select top 10 * from MYORDERS order by ORDERNO
>
>
>The query takes considerable time. I can sort of "see" that VFP selects all records and then selects 10 from the top. Is there a way to make this query run faster?
>

Use VFP 9. This is one of the areas where performance has improved in VFP 9. When I last tested, I couldn't see a difference between 8 and 9 on a medium-size table (about 75,000 records), but selecting the top 20 out of a million took about 1/3 the time in VFP 9 as in VFP 8.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform