This is a great idea. A related issue I've come across with the paginator is not being able to pass an explicit count into it.
If you have a query set with expensive annotations that don't effect the count in any way it's very wasteful to include them in the count SQL statement (on top of general PG count slowness), which Django does. Being able to pass in 'num_objects=x' would be great. On 7 Aug 2017 08:03, "Adam Johnson" <[email protected]> wrote: +1 from me, I've spent long enough on those COUNT(*) queries at work. Is it worth putting this logic in Paginator so applications can reuse it? On 7 August 2017 at 07:45, Josh Smeaton <[email protected]> wrote: > The admin list page performs a count(*) (twice!) when viewing the list > page of a model. One of these counts can be disabled, but the pagination > count can not be. On huge tables, this can be a massive performance issue. > https://code.djangoproject.com/ticket/8408 was created to disable the > count, but it only allowed disabling one of them. I've reopened the ticket > with Matthew who has implemented the suggestion to disable pagination > features that require count. > > PR: https://github.com/django/django/pull/8858 > > Does anyone have strong views one way or another here? Would like to hear > if so. > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit https://groups.google.com/d/ms > gid/django-developers/d093b4dd-4bc4-4c16-910d-53c4740ec5ea% > 40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/d093b4dd-4bc4-4c16-910d-53c4740ec5ea%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/ msgid/django-developers/CAMyDDM1Gs0vDhgGmMNFd29sftmvAd 53qibRo7DPUpLh%3DkwkZvw%40mail.gmail.com <https://groups.google.com/d/msgid/django-developers/CAMyDDM1Gs0vDhgGmMNFd29sftmvAd53qibRo7DPUpLh%3DkwkZvw%40mail.gmail.com?utm_medium=email&utm_source=footer> . For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFNZOJN-pAX%3DDMvzYs6e2_Kc%3Dg7JW%2BBkOTPz-eACV6AWNGph%3Dw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
