Details
Description
The LIKE clause for territory based characters was implemented correctly based on SQL standards in DERBY-2967 but the object (String and CollationElementIterator) creations introduced in DERBY-2967 can be cut down by following Knut's simple solution. I am copying that solution from DERBY-2967. We should implement that solution to improve the performance of LIKE for territory based characters.
*********copied from DERBY-2967*********************************************************
Another simple way to cut down the string allocations... I think you could express iapi.types.Like:checkEquality() like this:
if (val[vLoc] == pat[pLoc])
{ // same character, so two strings consisting of this // single character must be equal regardless of territory return true; }else if (collator == null)
{ // not same character, must be unequal in UCS_BASIC return false; }
String s1 = new String(val, vLoc, 1);
String s1 = new String(pat, pLoc, 1);
return collator.compare(s1, s2) == 0;
This would only allocate new objects if the characters are not equal.
Attachments
Issue Links
- is related to
-
DERBY-2699 performance of like in territory based collation databases may be improved by changing way collation elements are calculated.
- Closed
- relates to
-
DERBY-2698 caching collation elements in WorkHorseForCollatorDatatypes may improve performance.
- Open