#33046 closed Cleanup/optimization (fixed)
Fully cached result approach of the QuerySet.count is not documented.
| Reported by: | Can Sarıgöl | Owned by: | Can Sarıgöl |
|---|---|---|---|
| Component: | Documentation | Version: | 3.2 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
there is no document for count function docstring.
def count(self):
"""
...
If the QuerySet is already fully cached, return the length of the
cached results set to avoid multiple SELECT COUNT(*) calls.
"""
Change History (4)
comment:1 by , 4 years ago
| Component: | Uncategorized → Documentation |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 4 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
| Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
Hey Can! You want to add a note something like, If the queryset has already been fully retrieved, count will use that length rather than perform an additional query to the count() reference? Sounds OK, yes.