Currently decisions_view() calls _decisions_meets_quorum() which calls _decisions_count_voters "SELECT COUNT(DISTINCT CONCAT(uid,vote_source)) AS voters FROM {votingapi_vote} WHERE content_id=%d". This query was taking ~2 minutes to run in an environment with ~7 million rows in the votingapi_vote table.

The attached patch changes the code flow so that if both the quorum # of voters required and percentage are 0, further queries related to quorum are not performed when viewing the node.

CommentFileSizeAuthor
decisions-slow.patch1.2 KBezra-g

Comments

ezra-g’s picture

Status: Needs review » Fixed

This seems like a straighforward change and is now committed.

Status: Fixed » Closed (fixed)

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