Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2943

rewrite all occurances of WHERE LOWER(field) LIKE "string"

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      This seems to be all over the place. It's a real performance killer, and fairly useless. These should be rewritten as simply
      WHERE field LIKE "string"
      LOWER is implied in all LIKE comparisons, but LIKE without LOWER is way way way more efficient .
      My simple tests show it to be 4700% faster

      IMO the query engine should be smart enough to spot this, but apparently it isn't, so we should rewrite our queries.

      -dave

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              dalin dave hansen-lange
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: