Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INDEX ON ... THEN ... TAG
Message
De
23/07/2020 13:42:28
 
 
À
22/07/2020 16:30:04
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01675315
Message ID:
01675338
Vues:
57
>Rick,
>
>It's almost like we need this syntax:
>
INDEX ON iKeyField THEN cLastName, cFirstName TAG main
>

>
>You can sort of achieve this in VFP by something like
>
INDEX ON Transform(iKeyfield,'@0x')+cLastName+cFirstname tag main
>
>It's not a very efficient index with hundreds of thousands of rows sharing few characters, so you might be tempted to further transform the Transform(!) and you'd need to padr() if either of those fields is varchar, but SET EXACT and SET NEAR makes it possible to SEEK just Transform(m.limykey,'@0x') or Transform(m.limykey,'@0x')+"Hodgin" etc.

If utmost speed is needed, set key to iKey part of index, perhaps as range and it works great - but preselects the index, sometimes forcing redundancy

>
>The other option is that if you can use an ordered Remote view or other SQL construct using
>
ORDER BY iKeyField,cLastName,cFirstName
>Then desired order is maintained without an index.

Certainly possible and probably cleanest for remote data.
But if you want to have many such "views" and are working locally, my bet would be to have orders defined on a few indices without the ikey transform and trust rushmore to optimize a set filter as poor mans "set relation" or "set key"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform