On 24/11/2014 5:26pm, Andrus Adamchik wrote:
>> Will there be any awareness inside Cayenne of whether the column is already 
>> in a case-insensitive collation? Is that even possible in JDBC4?
> We've discussed it before and didn't have a solution (other than a global 
> policy for the entire app). Perhaps we can implement some "adaptive" 
> algorithm that gradually accumulates collation metadata over time for the 
> queries run by the app. Haven't given it much thought yet. Perhaps we can 
> start a separate thread if we want to discuss the backend (vs. the user API).

Yes, good point. Perhaps we need a big warning in the javadocs like this:

...likeIgnoreCase()
Note: Case insensitive matching is implemented in Cayenne by performing UPPER() 
on both sides of the query. Where you haven't added a functional index for this 
purpose (and some databases do not support functional indices at all), this can 
result in a huge performance hit. Use this method with caution and consider 
instead switching your database column to a case insensitive collation for 
better performance.

...like()
Although this method appears to be juxtaposed with likeIgnoreCase(), if your 
column collation is case-insensitive, this method will always perform a case 
insensitive search.


Ari


-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Reply via email to