mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #16895 -- Warned about cost of QuerySet ordering
Thanks outofculture at gmail.com for the suggestion.
This commit is contained in:
@@ -221,6 +221,12 @@ Django quotes column and table names behind the scenes.
|
||||
|
||||
ordering = ['-pub_date', 'author']
|
||||
|
||||
.. warning::
|
||||
|
||||
Ordering is not a free operation. Each field you add to the ordering
|
||||
incurs a cost to your database. Each foreign key you add will
|
||||
impliclty include all of its default orderings as well.
|
||||
|
||||
``permissions``
|
||||
---------------
|
||||
|
||||
|
||||
@@ -334,6 +334,12 @@ You can tell if a query is ordered or not by checking the
|
||||
:attr:`.QuerySet.ordered` attribute, which will be ``True`` if the
|
||||
``QuerySet`` has been ordered in any way.
|
||||
|
||||
.. warning::
|
||||
|
||||
Ordering is not a free operation. Each field you add to the ordering
|
||||
incurs a cost to your database. Each foreign key you add will
|
||||
impliclty include all of its default orderings as well.
|
||||
|
||||
reverse
|
||||
~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user