Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
cbf08c6b
Kaydet (Commit)
cbf08c6b
authored
Eyl 08, 2013
tarafından
e0ne
Kaydeden (comit)
Tim Graham
Eyl 09, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #16895 -- Warned about cost of QuerySet ordering
Thanks outofculture at gmail.com for the suggestion.
üst
1185370c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
options.txt
docs/ref/models/options.txt
+6
-0
querysets.txt
docs/ref/models/querysets.txt
+6
-0
optimization.txt
docs/topics/db/optimization.txt
+11
-0
No files found.
docs/ref/models/options.txt
Dosyayı görüntüle @
cbf08c6b
...
...
@@ -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``
---------------
...
...
docs/ref/models/querysets.txt
Dosyayı görüntüle @
cbf08c6b
...
...
@@ -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
~~~~~~~
...
...
docs/topics/db/optimization.txt
Dosyayı görüntüle @
cbf08c6b
...
...
@@ -306,6 +306,17 @@ instead of::
entry.blog.id
Don't order results if you don't care
-------------------------------------
Ordering is not free; each field to order by is an operation the database must
perform. If a model has a default ordering (:attr:`Meta.ordering
<django.db.models.Options.ordering>`) and you don't need it, remove
it on a ``QuerySet`` by calling
:meth:`~django.db.models.query.QuerySet.order_by()` with no parameters.
Adding an index to your database may help to improve ordering performance.
Insert in bulk
==============
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment