#35637: Paginator executes additional SQL query when using QuerySet
-------------------------------------+-------------------------------------
     Reporter:  amir-mahdih86        |                    Owner:  (none)
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  5.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  Paginator,           |             Triage Stage:
  Queryset, Performance, SQL         |  Unreviewed
  Queries                            |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by David Sanders):

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

Comment:

 Thanks though this is intentional.  Part of the reason why pagination is
 used is to avoid loading large datasets which would likely result in
 failures. The additional count query is to get the total number of records
 without loading the entire result set.

 As you've discovered, if folks want to avoid the additional query they can
 materialise the queryset before passing to the paginator.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35637#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190f8f952c6-614bcb8e-da90-42e2-b870-cc31f1f5e775-000000%40eu-central-1.amazonses.com.

Reply via email to