Re: Use case for a "case insensitive equals" qualifier
Re: Use case for a "case insensitive equals" qualifier
- Subject: Re: Use case for a "case insensitive equals" qualifier
- From: "Morris, Mark" <email@hidden>
- Date: Thu, 25 Feb 2016 15:16:22 +0000
- Thread-topic: Use case for a "case insensitive equals" qualifier
Hi Lon,
We run into this a lot, and I have a rather complex solution for a “case insensitive begins with” qualifier that actually works well, at least with Oracle and its indexing. My method returning this qualifier is actually about 60 lines, but most
of that is optimizations for special cases. (We have terabytes of data, so every little bit helps!)
The basic idea, though, is that it only takes a couple of characters to hit on an index and make a huge difference in performance. So…
Trying to case-insensitive-equals match " email@hidden” with the search term “ email@hidden”, you would build this sort of qualifier:
(emailAddress like ‘PA*’ OR emailAddress like ‘Pa*’ OR emailAddress like ‘pA*’ OR emailAddress like ‘pa*’) AND UPPER(emailAddress) = UPPER(' email@hidden’)
Hope this helps!
Regards,
Mark
On Feb 24, 2016, at 7:12 PM, Chuck Hill < email@hidden> wrote:
If you always want the comparison to be case insensitive, then you should be able to specify a database collation for the column that is insensitive. Then just just a regular equals qualifier. If you want it case sensitive sometimes and insensitive
others, that is a different problem.
Chuck
Hmm, it would be interesting if there was an alternative, but really the problem lies in the database. Any wildcard type searches (at least that start with a wildcard) are not likely to use indexes and cause a table scan. If your database
supported the concept of having case-insensitive indexes, then I would think it would be pretty trivial to implement in your own qualifier. In Sybase (the database I use mostly) you can create a functional index (an index based on a function), but it’s the
equivalent creating a second column that’s always lower and maintaining an index on it. The difference being that the database maintains it for you (which is usually annoying for EOF).
I’ve always wanted a better way to do this too.
-Lon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ( email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden