Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore'ing substrings
Message
From
21/01/2003 16:24:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00743958
Message ID:
00743962
Views:
25
>Is there a way to optimize a select when looking for substrings ($) of a character field. A table (500,000+ records) on a LAN with an index on UPPER(ALLTRIM(somefield)) is acceptably fast when we do this...
>
>SELECT * FROM sometable WHERE ;
>UPPER(ALLTRIM(somefield)) = UPPER(ALLTRIM(variable))
>
>... but if we ...
>
>SELECT * FROM sometable WHERE ;
>UPPER(ALLTRIM(variable)) $ UPPER(ALLTRIM(somefield))
>
>... it is horribly slow. Any suggestions on how to speed that up?
>
>Thank you.

First of all, you should not have an index on alltrim(something), since this will give you a variable expression length. VFP doesn't support this, and it will put an almost arbitrary length (actually based on the first record it finds, I think).

Queries on "$" are fairly difficult to roptimize. You might want some utility like phdBASE that creates an index on each word.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform