When filter queryset using ManyToManyField, it takes too much sql queries.For avoid this situation, we can use annotate.CountWith django.db.models.Count, you can count number of m2m objects.For example, if want to filter queryset having more than one ManyToManyField called product (for example)from django.db.models import Count ... queryset = queryset.annotate(product_num=Count('product')).filte..