Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to speed this loop and/or SQL up?
Message
De
18/03/2005 11:06:02
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
18/03/2005 10:56:44
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 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00997258
Message ID:
00997275
Vues:
11
This message has been marked as the solution to the initial question of the thread.
>Hilmar
>
>>It seems it is the last SELECT statement that takes too long, right?
>>
>>Do you have indices on the most important expressions?
>
>Yes I have the table indexed (see line 2)
>
>>>Select RZSTOP
>>>Set Order To RGDSNum && RTE_NO+RTE_LET+DIRECTN+STR(SEQNO,4)+STR(NUMBER,

If you have an index on the combined expression, a SEEK on the combined expression would be extremely fast. On the other hand, this index would not be used to optimize the SELECT statement as you posted it. For example, an index on Field1 + Field2 would only be used if you include a WHERE Field1 + Field2 = ...". IOW, the index has to exactly match part of the WHERE clause, or all of it.

>Well, as there could be many J rec's with the same RTE_NO + RTE_LET + DIRECTN (c.f. Composite PK), but, of course, incrementally differnnet SEQNOs, do you mean I should knock off the PK?

No, apart from the fact that you need it, the primary key has unique value, and will cause no problem. I mean to knock of indices that have only a few possible values.
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform