[Django] #28399: Combined queries (UNION etc) do not properly count in the database.

10 views
Skip to first unread message

Django

unread,
Jul 14, 2017, 12:11:09 PM7/14/17
to django-...@googlegroups.com
#28399: Combined queries (UNION etc) do not properly count in the database.
-------------------------------------+-------------------------------------
Reporter: Florian | Owner: nobody
Apolloner |
Type: Bug | Status: new
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Currently combined queries do not issue COUNT(*) in the database which is
not really efficient one wants to paginate through them.

--
Ticket URL: <https://code.djangoproject.com/ticket/28399>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 14, 2017, 1:20:55 PM7/14/17
to django-...@googlegroups.com
#28399: QuerySet.count() doesn't work on combined queries (union, intersection,
difference)
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* version: master => 1.11
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


Comment:

I didn't realize this could be supported (see #27995). #27982 and #27990
were duplicates.

--
Ticket URL: <https://code.djangoproject.com/ticket/28399#comment:1>

Django

unread,
Jul 15, 2017, 9:20:45 AM7/15/17
to django-...@googlegroups.com
#28399: QuerySet.count() doesn't work on combined queries (union, intersection,
difference)
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"adab280cefb15659c39558ac26ea392b0a1e456c" adab280c]:
{{{
#!CommitTicketReference repository=""
revision="adab280cefb15659c39558ac26ea392b0a1e456c"
Fixed #28399 -- Fixed QuerySet.count() for union(), difference(), and
intersection() queries.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28399#comment:2>

Django

unread,
Jul 15, 2017, 9:33:10 AM7/15/17
to django-...@googlegroups.com
#28399: QuerySet.count() doesn't work on combined queries (union, intersection,
difference)
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"9350f77c69a5cef3d7a9b8078ab33ff43335a112" 9350f77c]:
{{{
#!CommitTicketReference repository=""
revision="9350f77c69a5cef3d7a9b8078ab33ff43335a112"
[1.11.x] Fixed #28399 -- Fixed QuerySet.count() for union(), difference(),
and intersection() queries.

Backport of adab280cefb15659c39558ac26ea392b0a1e456c from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28399#comment:3>

Reply all
Reply to author
Forward
0 new messages