(Not yet an Answer.)
If I read it correctly, the two "Group aggregate count(distinct...)" steps consume nearly all the time.
Group aggregate: count(distinct member_vote.vote_id)
Group aggregate: count(distinct party_statistic.vote_id)
Can you explain what is going on there?