Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT statement executes very slow
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01376652
Message ID:
01376664
Views:
11
You don't have to change SET ANSI in VFP9. The LIKE operator will be optimized if an index on itm_numb exists regardless of SET ANSI setting. It's also compatible with other databases.
SELECT itm_numb,itm_desc FROM A WHERE itm_numb LIKE 'STI%'
>Do you have an index on itm_numb ?
>
>If you have SET ANSI OFF, then you should be able to just use:
>
>
>SELECT itm_numb,itm_desc FROM A WHERE itm_numb='STI'
>
>
>which should take advantage of the index which you should then be able to confirm with the SYS(3054, command.
>
>
>By using SUBSTR(itm_numb,3) you're not allowing RUSHMORE to optimize unless you specifically have an index on SUBSTR(itm_numb,3)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform