Instead of comparing strings in much faster to compare ints (not that will have a huge impact in this case :P).

`Q(id=poll.valid_groups.id)`