Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3136

Cut down on object creations in LIKE clause implementation of territory based characters.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.3.2.1, 10.4.1.3
    • 10.3.2.1, 10.4.1.3
    • SQL
    • None

    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

          Activity

            People

              mamtas Mamta A. Satoor
              mamtas Mamta A. Satoor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: