Skip to content

Commit 441618a

Browse files
committed
Update manual to explain JoinQueryset instead of JoinManager
1 parent 1ca51a5 commit 441618a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/managers.rst

+9-6
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ it's safe to use as your default manager for the model.
8686

8787
.. _contributed by Jeff Elmore: https://jeffelmore.org/2010/11/11/automatic-downcasting-of-inherited-models-in-django/
8888

89-
JoinManager
90-
-----------
89+
JoinQueryset
90+
------------
9191

92-
The ``JoinManager`` will create a temporary table of your current queryset
93-
and join that temporary table with the model of your current queryset. This can
92+
A ``JoinQueryset`` will create a temporary table containing its own query result
93+
and join that temporary table with the model it is querying. This can
9494
be advantageous if you have to page through your entire DB and using django's
9595
slice mechanism to do that. ``LIMIT .. OFFSET ..`` becomes slower the bigger
9696
offset you use.
@@ -102,8 +102,9 @@ offset you use.
102102
# qs contains 10 objects, and there will be a much smaller performance hit
103103
# for paging through all of first 2000 objects.
104104
105-
Alternatively, you can give it a queryset and the manager will create a temporary
106-
table and join that to your current queryset. This can work as a more performant
105+
Alternatively, you can give it another queryset and ``JoinQueryset`` will create
106+
a temporary table containing the result of the given queryset and
107+
join that temporary table to itself. This can work as a more performant
107108
alternative to using django's ``__in`` as described in the following
108109
(`StackExchange answer`_).
109110

@@ -114,6 +115,8 @@ alternative to using django's ``__in`` as described in the following
114115
115116
.. _StackExchange answer: https://dba.stackexchange.com/questions/91247/optimizing-a-postgres-query-with-a-large-in
116117

118+
You can create a manager that produces ``JoinQueryset`` instances using ``JoinQueryset.as_manager()``.
119+
117120
.. _QueryManager:
118121

119122
QueryManager

0 commit comments

Comments
 (0)