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-02-03