File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,12 +189,10 @@ Doing the following is potentially quite slow:
189189First of all, ``headline`` is not indexed, which will make the underlying
190190database fetch slower.
191191
192- Second, the lookup doesn't guarantee that only one object will be returned.
193- If the query matches more than one object, it will retrieve and transfer all of
194- them from the database. This penalty could be substantial if hundreds or
195- thousands of records are returned. The penalty will be compounded if the
196- database lives on a separate server, where network overhead and latency also
197- play a factor.
192+ Second, the lookup may return multiple results. Even though Django applies a
193+ limit of 21 objects when using :meth:`~django.db.models.query.QuerySet.get`,
194+ the database may still need to scan everything to evaluate a non-unique
195+ condition. Narrowing your query up-front is more efficient.
198196
199197Retrieve related objects efficiently
200198====================================
You can’t perform that action at this time.
0 commit comments