[1.11.x] Linked to prefetch_related_objects func in DB optimization docs.
Backport of e283c1a from master
This commit is contained in:
parent
be45c90ce3
commit
a09e974688
@ -195,12 +195,13 @@ Understand :meth:`~django.db.models.query.QuerySet.select_related` and
|
|||||||
:meth:`~django.db.models.query.QuerySet.prefetch_related` thoroughly, and use
|
:meth:`~django.db.models.query.QuerySet.prefetch_related` thoroughly, and use
|
||||||
them:
|
them:
|
||||||
|
|
||||||
* in view code,
|
* in :doc:`managers and default managers </topics/db/managers>` where
|
||||||
|
|
||||||
* and in :doc:`managers and default managers </topics/db/managers>` where
|
|
||||||
appropriate. Be aware when your manager is and is not used; sometimes this is
|
appropriate. Be aware when your manager is and is not used; sometimes this is
|
||||||
tricky so don't make assumptions.
|
tricky so don't make assumptions.
|
||||||
|
|
||||||
|
* in view code or other layers, possibly making use of
|
||||||
|
:func:`~django.db.models.prefetch_related_objects` where needed.
|
||||||
|
|
||||||
Don't retrieve things you don't need
|
Don't retrieve things you don't need
|
||||||
====================================
|
====================================
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user