I have an index in place (from days of old) that I'm curious about. It's on a basic person table and the function is
upper("LAST_NAME"||','||"FIRST_NAME"||"MIDDLE_NAME"||"SUFFIX_NAME")
When trying to search on this index, I wind up with a full table scan. Any idea why? And if this is just completely broken like I think it is, would you suggest a column index on these four columns?
EDIT
Sorry about not providing the query. Yes, the query is a like, and the columns are all nullable. So I have
select *
from person p
where UPPER("LAST_NAME"||','||"FIRST_NAME"||"MIDDLE_NAME"||"SUFFIX_NAME")
like replace(upper('<search string here>'), '*', '%') || '%'
Any thoughts? Thanks for the quick answer.
wheremust match the function exactly to use the index – Jack Douglas♦ Aug 25 '11 at 22:07