Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Case Insensitive Indexes

598967Nov 5 2007 — edited Nov 9 2007
In relation to switching on case insensitive queries using
alter session set NLS_COMP=LINGUISTIC;
Can anyone answer the following?
>
Yes, it works.... but I can't for the life of me figure out how to build a linguistic index that the LIKE clause will actually use. Building an index thus, for example:

create index bin_ai on names(NLSSORT("NAME",'nls_sort=''BINARY_AI'''));

makes an index which does get used to good effect by queries such as
select name from names where name = 'Johny Jacobson';
but not by
select name from names where name like 'Johny%';

Hence, in a real-world test with 100,000 records, the LIKE query runs about 100 times slower than the '=' query (3 sec compared to 0.03 sec). Not very scalable. Is there a way to speed this up??


Also is it possible to set session variables such as nls_comp on a database/schema/user level?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2007
Added on Nov 5 2007
20 comments
2,531 views