diff options
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/db/optimization.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index 69eb58212a..180cd60a46 100644 --- a/docs/topics/db/optimization.txt +++ b/docs/topics/db/optimization.txt @@ -240,6 +240,12 @@ row in the results, even if it ends up only using a few columns. The lot of text data or for fields that might take a lot of processing to convert back to Python. As always, profile first, then optimize. +Use ``QuerySet.contains(obj)`` +------------------------------ + +...if you only want to find out if ``obj`` is in the queryset, rather than +``if obj in queryset``. + Use ``QuerySet.count()`` ------------------------ |
