Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the best index expression?
Message
De
18/04/2005 14:35:13
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01005870
Message ID:
01005918
Vues:
21
My vote would go to this solution:
*-- Have an index on these two fields:

INDEX ON EMPTY (InsCommand) TAG E_InsCmd
INDEX ON SearchTB TAG SearchTB
SET ORDER TO

*-- Scan the table

SCAN FOR SearchTB = m.lcSearch AND NOT EMPTY (InsCommand)
   ...

   IF m.plError
      EXIT
   ENDIF
ENDSCAN
>Right now I just have an index on SearchTB. I'm thinking, do I need to try to optimize the rest of the expression, e.g. have an index on empty(InsCommand) as you suggest or use the scan for as it is or do the check inside the scan...
>
>Or use the "scan while" technique and use filtered index.
>
>I just can not test every possible scenario, and these tests are very costly...
>
>>>I'm thinking, could it be better to use filtered index instead.
>>>
>>>E.g. currently I do:
>scan for m.plError=.f. and SearchTB = m.lcSearch and not empty(InsCommand)
>May be it would be faster to set a filtered index and do seek, when scan while?
>>>
>>>However, as I recall, I tried similar idea (in another context, though) and it actually slowed it down.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform