#28399 closed Bug (fixed)
QuerySet.count() doesn't work on combined queries (union, intersection, difference)
| Reported by: | Florian Apolloner | Owned by: | nobody | 
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.11 | 
| Severity: | Release blocker | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
Currently combined queries do not issue COUNT(*) in the database which is not really efficient one wants to paginate through them.
Change History (3)
comment:1 by , 8 years ago
| Severity: | Normal → Release blocker | 
|---|---|
| Summary: | Combined queries (UNION etc) do not properly count in the database. → QuerySet.count() doesn't work on combined queries (union, intersection, difference) | 
| Triage Stage: | Unreviewed → Accepted | 
| Version: | master → 1.11 | 
  Note:
 See   TracTickets
 for help on using tickets.
    
I didn't realize this could be supported (see #27995). #27982 and #27990 were duplicates.