Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCAN and query result
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00537855
Message ID:
00539441
Views:
13
I agree, INDEXSEEK() will be more efficient in this case.

>Sergey,
>
>A variation on the theme (at least I think I see a theme developing in this thread):
>
>
>SELECT DISTINCT KeyField ;
>  FROM AnotherTable ;
>  INTO CURSOR KeyCursor
>
>INDEX ON KeyField TAG KeyField
>
>SELECT MyTable
>SCAN FOR INDEXSEEK(MyTable.KeyField, .F., "KeyCursor", "KeyField")
>  ... do stuff
>ENDSCAN
>
>USE IN KeyCursor
>
>
>Advantages:
>Not relying on a SET RELATION.
>Faster... when your doing an INDEXSEEK("", .F.) the record pointer in KeyCursor doesn't move. You're just traversing the CDX.
>
>
>One thing you absolutely do not want to do is add a UDF to a SQL query. VFP will run the UDF with every row of the source cursor, which KILLS performance.
>
>Regards,
>Thom C.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform