@@ -86,11 +86,11 @@ it's safe to use as your default manager for the model.
86
86
87
87
.. _contributed by Jeff Elmore : https://jeffelmore.org/2010/11/11/automatic-downcasting-of-inherited-models-in-django/
88
88
89
- JoinManager
90
- -----------
89
+ JoinQueryset
90
+ ------------
91
91
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
94
94
be advantageous if you have to page through your entire DB and using django's
95
95
slice mechanism to do that. ``LIMIT .. OFFSET .. `` becomes slower the bigger
96
96
offset you use.
@@ -102,8 +102,9 @@ offset you use.
102
102
# qs contains 10 objects, and there will be a much smaller performance hit
103
103
# for paging through all of first 2000 objects.
104
104
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
107
108
alternative to using django's ``__in `` as described in the following
108
109
(`StackExchange answer `_).
109
110
@@ -114,6 +115,8 @@ alternative to using django's ``__in`` as described in the following
114
115
115
116
.. _StackExchange answer : https://dba.stackexchange.com/questions/91247/optimizing-a-postgres-query-with-a-large-in
116
117
118
+ You can create a manager that produces ``JoinQueryset `` instances using ``JoinQueryset.as_manager() ``.
119
+
117
120
.. _QueryManager :
118
121
119
122
QueryManager
0 commit comments