Re: Case insensitive searches

From: Ryan January <>
Date: Tue, 18 Mar 2014 08:12:18 -0500
Message-ID: <>

Thank you for all the responses so far.

Stéphane: Function based indexes were the first solution that came to mind. Especially considering that we'd possibly require them to support the NLS changes, similar to what Martin is suggesting. Unfortunately we felt it wasn't a good fit for a few reasons. Mainly, the varchar fields are a secondary search criteria. Table access would generally be through existing indexes on integer columns. You make a very good point about constraints and insuring uniqueness. I don't believe we'll run into issues here but it is something I'll have to keep in mind. Internationalization was our main reason to avoid storing varchar values case insensitive within the database. We do support multiple languages and want to avoid that situation if at all possible.

Herald: We have considered Oracle text in the past, however decided against it due it's inability to perform partial word searches. The words 'App' and 'Apple' would bring back very different search results. I'll read back through the Oracle text docs today to see if we overlooked anything or if it's been extended since we last reviewed it. Even if it isn't a fit here, I can think of a few other areas it may be beneficial.

Rajendra: We had not considered regex. The reason we were included within the discussion was to make a general sweeping change in an attempt to reduce the impact on the application code base. Ultimately that's why we began to consider the NLS settings. This is something we may look at if it comes to modifying the queries within the application.

Norm: This is what I've been considering as a next step. The main complaint started out that a user felt the search results were incorrectly sorted, they hadn't yet realized the searches were case sensitive. After we explained it was working as expected they also brought up the need for case insensitive searching. (eg: Ryan = ryan) Given that most table access will be through existing indexes I'm thinking we propose this change as at least a temporary solution. My worry is that going down this road will cause us to eventually modify the queries to allow case insensitive compares as well.

Martin: I'm glad to see someone who has had success with this approach. When we started seeing this issue so soon I felt we may be wondering down a path rarely traveled. I'm at least willing to put a little additional time in the NLS settings as a solution. As you've mentioned, we're setting these params at the session level and only for the few app users who require it. Unfortunately the query that surfaced this issue was of a moderately complex view which involves a few sys owned objects. We're still trying to narrow down the table access which is actually causing the problem. Since the bug referenced is specifically sort/nosort operations within the execution plan I expected this to be an issue with the index itself. If the issue ends up being with these sys object access methods I'm not sure where we'll go next. This is something I'll be digging into momentarily. Did you remove/replace all the existing varchar indexes or additionally supplement with the NLS specific indexes? Do any of your applications interact with any oracle owned tables/views? If so, how do you approach those situations?

On 03/18/2014 07:28 AM, Martin Klier wrote:
> Hi Ryan,
> we are running more than 50 projects on 11.2.x with NLS_SORT set to
> We do two things:
> * both parameters are only set on session level for the app users and
> NOT for SYSTEM or the dictionary owner.
> * all VARCHAR field indexes are changed to function based:
> Because this function is what Oracle wraps around any string search when
> the mentioned parameters are set.
> Hope this helps
> Martin Klier
> Am 17.03.2014 23:02, schrieb Ryan January:


This email is intended solely for the use of the addressee and may
contain information that is confidential, proprietary, or both.
If you receive this email in error please immediately notify the
sender and delete the email..

Received on Tue Mar 18 2014 - 14:12:18 CET

Original text of this message