Hi folks,

my experiences of this are with a release of Sybase where case-insensitive 
prefix searching of indexed columns caused table-scanning of a very big table, 
and assorted releases of MySQL with case-insensitive collation sequences.  I 
used to use the EOEditingContext delegate API to spot that a fetch was about to 
occur, and possibly reconstruct the qualifier.  The SQL my custom qualifier 
code was generating (WO451 + Sybase, about 6 years ago ... today, WO451 + 
MySQL) would have looked something like this:


((emailAddress >= 'P' AND emailAddress < 'Q') OR (emailAddress >= 'p' AND 
emailAddress < 'q'))
AND
(lower(emailAddress) = 'pa...@logicsquad.net')


and it worked very well for us because the query plans used indexes as 
intended, but, noting the comments elsewhere on this thread about collation 
sequences for alphabetic characters with diacritics.


-- Patrick



________________________________
From: webobjects-dev-bounces+pmiddleton=onestep.co...@lists.apple.com 
<webobjects-dev-bounces+pmiddleton=onestep.co...@lists.apple.com> on behalf of 
Morris, Mark <mark.mor...@experian.com>
Sent: Thursday, February 25, 2016 3:16 PM
To: Lon Varscsak
Cc: WebObjects Development
Subject: Re: 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 
"pa...@logicsquad.net<mailto:pa...@logicsquad.net>" with the search term 
"pa...@logicsquad.net<mailto:pa...@logicsquad.net>", 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('pa...@logicsquad.net<mailto:pa...@logicsquad.net>')

Hope this helps!

Regards,
Mark

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to