When querying many-to-many relationships, avoid using multiple filter() methods, make use of Q() objects instead . You can check the SQL query of a QuerySet with str(queryset. query) . Check the performance of recently executed SQL queries with django.