Remove DISTINCT from get_by_sites query, which is apparently what makes it slow