Sorry, but your 'work-around' is nonsensical. I have already specified when an index is and isn't used and I already specified the workarounds
Your query is wrong:
SELECT * FROM table_name WHERE UPPER(name) LIKE '%ABC%'
Will find:
xABCx
xaBcx
xabcx
SELECT * FROM table_name WHERE UPPER(name) LIKE '%ABC%'
AND (name LIKE '%ABC%' OR name LIKE '%abc%' );
Will find:
xABCx
xabcx
Notice that the 2 result sets are different.
Attempting to fix it manually will simply kill you once you get to 4 or 5 characters in length because of the sheer number of permutations.
As I said before:
- Hint the index, it will run faster than the table-scan.
OR
- Create a function-based index
OR
- Use the InterMedia functionality, if it is applicable to your situation.
- Chris
