Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query on combined index
Message
 
 
À
10/06/2002 08:36:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00666475
Message ID:
00666536
Vues:
17
This message has been marked as the solution to the initial question of the thread.
You can use SYS(3054,11) to check optimization level. My tests show that VFP is "smart" enough to match join condition to the index expression in this case.

>I have an index on two fields. Would an expression like the following be Rushmore-optimized, that is, would the index be used?
>
>
>select (some fields);
>  from Table1 join Table2 on bintoc(Table1.Field1) + bintoc(Table1.Field2);
>    = bintoc(Table2.Field1) + bintoc(Table2.Field2)
>
>
>Suppose that one table, or both, are indexed on bintoc(Field1) + bintoc(Field2).
>
>It seems to me that the answer is "no", since, because of the alias, the expression no longer "exactly matches the index". In that case, how can the index be utilized efficiently?
>
>I know I can use a lookup function (I have a generic UDF for lookups), but I was thinking whether there was a way in "pure SQL".
>
>TIA, Hilmar.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform