This query from acitivity_cron is showing up in slow query logs on a client site.

 $uid_sql = "SELECT uid, min(created) as min, count(aid) as count FROM {activity} GROUP BY uid HAVING min < %d AND count > %d";

I can't yet find a way to optimize the query itself, however it seems like it'd be easy enough to use core's flood protection to prevent it from running every cron run - i.e. just run it once per day by default.

Should be able to get a patch for this going later.

CommentFileSizeAuthor
#2 activity_throttle.patch3.77 KBcatch
#1 activity_throttle.patch3.83 KBcatch

Comments

catch’s picture

Status: Active » Needs review
StatusFileSize
new3.83 KB

OK D6 doesn't have as nice a flood protection API as D7, so implemented this with a variable instead. Will test this a bit later on.

catch’s picture

StatusFileSize
new3.77 KB

Cleaner patch.

catch’s picture

Tested this with a couple of cron runs and it looks to be working as expected.

_shy’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

D6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.