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)