In privatemsg_sql_deleted() a query is run against pm_message and then joined to pm_index. This is unnecessary because all the fields we want to select or filter on are in pm_index.

I believe that we can improve the performance of the query by getting rid of the join and only using the smaller pm_index table.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hosef created an issue. See original summary.

hosef’s picture

Here is an initial patch that improved performance in my tests.

oadaeh’s picture

Status: Needs review » Reviewed & tested by the community

The code looks good, and it operates correctly & quicker than the original.

Kristen Pol’s picture

This looks good to me too. RTBC++

  • oadaeh committed 6f0dbc7 on 7.x-2.x authored by hosef
    Issue #2659226 by hosef, oadaeh, Kristen Pol: Improve the performance of...
oadaeh’s picture

Status: Reviewed & tested by the community » Fixed

This patch has been in production for over a year, so I think it is okay.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.