Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query on combined index
Message
De
10/06/2002 08:36:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Query on combined index
Divers
Thread ID:
00666475
Message ID:
00666475
Vues:
55
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.
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)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform