Showing posts with label NLS settings for case in sensitive search. Show all posts
Showing posts with label NLS settings for case in sensitive search. Show all posts

Friday, September 10, 2010

Case in-sensitive search

To enable case in-sensitive search
============================
alter session set NLS_COMP=LINGUISTIC;
alter session set NLS_SORT=BINARY_CI

ABove would cause CBO to use full table scans on some tables (as indexes are not case sensitive by default), so performance may have big impact.

Workaround
============
Create linguistics indexes on such table columns, so that CBO would use such indexes for case in-sensitive queries. e.g

CREATE INDEX nls_tst2_ind on TST2(nlssort(f1,'NLS_SORT=BINARY_CI'));


CREATE INDEX nls_ind_tst on APRIMO.aud_member_ext_attributes(nlssort(ExtValue3906,'NLS_SORT=BINARY_CI'));

CREATE INDEX APRIMO.aud_mem_ext_attr_3906_ind on APRIMO.aud_member_ext_attributes(nlssort(ExtValue3906,'NLS_SORT=BINARY_CI'));