A while ago (I think while I was working on #935106: Split out project taxonomy terms from the generic "Tags" into vocabulary-specific display) I noticed that project_usage_get_project_total_usage() is really inefficient. The code is easy to write, but the result is that we call project_usage_get_project_usage() in a loop, each time generating a new DB query. It'd be better to just run a single query to get all the usage counts for a API compatibility terms and just add them up directly, instead of querying for each one independently.

Just found the diff in an old workspace and didn't want to lose it so I'm opening an issue about it. ;)

CommentFileSizeAuthor
#1 997822-1.usage-stat-query-efficiency.patch1.05 KBdww
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Status: Active » Needs review
FileSize
1.05 KB

Status: Needs review » Needs work

The last submitted patch, 997822-1.usage-stat-query-efficiency.patch, failed testing.