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

Performance improvment in CRM_Contact_BAO_Contact_Permission::cache

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.3.6
    • Fix Version/s: 4.1.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      The Contact Permission cache function currently fetches rows, groups them by self::NUM_CONTACTS_TO_INSERT, and does buffered bulk REPLACE INTO queries.

      This patch pushes that work into the database by embedding the SELECT statement into an INSERT query and buffering the INSERTS using the LIMIT and OFFSET functions. The REPLACE aspect of the job is handled by the ON DUPLICATE UPDATE clause which, instead of dropping the old and inserting the new, updates the values in place in the table.

      This improved functionality requires MySQL 5.1 or greater.

        Attachments

        1. permission_cache3.diff
          2 kB
          Graylin Kim
        2. permission_cache4.diff
          2 kB
          Graylin Kim

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              shadesofgraylin Graylin Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: