Nested Subquerys in Django June 28, 2024 Articles Refactoring an initial loop that triggered one set of N+1 queries and, for each of those, another query that probably gets to NM+1 queries!