N + 1 Problem
Usually an issue for ORMs
Django and the N+1 Queries Problem
Example: printing all book titles
results in these queries
N queries that look like this
Solutions¶
SQL¶
Use a view or a join
Django¶
does ths
- [[Django ORM#
select_related
]] - [[Django ORM#
prefetch_related
]]
GraphQL¶
Last update:
2023-04-24