Getting functional indexes to work (IDS/UDO 9.14)
Posted in 1998
Given:
A user registration table with first and last names etc.
I want to do a case insensitive search :
select * from USER where lower(last_name) like lower('WeAvEr%');
Obviously, this performs a table scan even with an index on last name.
I've create the following functional index
Create index i_lname on USER (lower(last_name)) in default;
The results of "set explain on" show the index is not being used in the
following queries. The table has almost 200,000 rows in it.
select * from USER where last_name like lower('WeAVer%');
select * from USER where last_name = lower('WeAVER');
select * from USER where lower(last_name) like lower('WeAVer%');
select * from USER where lower(last_name) = lower('WeAVER');
Has anyone out there ever gotten a functional index to work? How? Or,
are there any recommendations for performing a case insensitive "LIKE"
while using an index.
Thanks,
Eric Weaver, InteliHealth
eweaver@intelihealth.com