Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to optimize a query ?
Message
De
24/01/2009 12:37:58
 
 
À
24/01/2009 12:34:53
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01376743
Message ID:
01376744
Vues:
34
>Hello Experts...
>
>The following query takes almost 5 minutes to show results on a table containing 290K records. How can I optimatize it ?statement:
>
>
>
>SELECT itm_numb,itm_desc FROM A WHERE itm_desc LIKE '%TOOLS%'
>
>
>
>The table is indexed on both fields. The code page matches and is set to 1252 (Windows ANSI), of both the table and the envirement.
>The RUSHMORE optimizer (SYS(3054, 1) returns :none.
>
>Any idea ?
>
>Raz

It's not possible to optimize your query! You want to search for a givem text inside a field, so VFP must check every record. But if you know that the field starts with the text you specify, your query will be optimized. In other words, if you remove the first %, you get full speed.
SELECT itm_numb,itm_desc FROM A WHERE itm_desc LIKE 'TOOLS%'
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform