Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query on combined index
Message
From
10/06/2002 08:36:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Query on combined index
Miscellaneous
Thread ID:
00666475
Message ID:
00666475
Views:
56
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)
Next
Reply
Map
View

Click here to load this message in the networking platform