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

Add index to civicrm_cache for improved cleanup times

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.3
    • Fix Version/s: 4.2.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      CRM-10264 calls cache cleanup more frequently, and I believe the performance of this query can be improved with some additional indexing.

      On a quick test, I was able to reduce the query time from 1s to .22s with this index for a simulated cache cleanup.

      Proposed fix -

      ALTER TABLE civicrm_cache ADD INDEX civicrm_cache_idx (group_name, path, created_date)

      Ugly bash script to reproduce unscientific testing is attached

        Attachments

        1. test.sh
          2 kB
          Chris Burgess
        2. test.sh
          2 kB
          Chris Burgess

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              xurizaemon Chris Burgess
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: