Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.0
    • Fix Version/s: 4.4.0
    • Component/s: CiviMail
    • Labels:
      None

      Description

      we were noticing significant performance sluggishness in the new mailings tab for sites with a large number of mailings. we traced it to how the open/click stats were being generated. there were a few issues:

      • the stats were generated by cycling through the mailings for the contact and calling the getRows method for clicks and stats. that meant a lot of queries. for a contact with 75 mailings, that's 150 additional queries just to get those stats.
      • the getRows method never should have been used, as it pulls a lot of data unnecessarily. and once the rows were retrieved, we used an array count to get the stat, which added to the slowness

      I first used the existing method getTotalCount for opens/clicks respectively. in my test case, that reduced load time from 30 sec to about 1. the query is much simpler, more direct, and doesn't require the array count. however, it still means we are querying 150 times for a contact with 75 mailings.

      So I opted to create a new method that generates all the counts in a single query given a list of mailing IDs (which we've already generated anyway), then passes them back in an array.

      Here's our commit. Please take a quick look and give the thumbs up, and I'll file a patch against core.
      https://github.com/nysenate/Bluebird-CRM/commit/9ef4bfe3842a0fa501c0870216e3fcd58b2be18e

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: