Re: Optionally using a custom queryset for Paginator and MultipleObjectMixin (ListView)

2018-07-17 Thread Ramiro Morales
On Sat, Jun 30, 2018 at 12:40 PM Tom Forbes  wrote:

> Are you sure it is the prefetches that is causing this? As Adam pointed
> out these are correctly ignored. Annotations however are not, which can
> cause unnecessary work and longer execution times. i.e:
>
> Book.objects.annotate(something=Max('pages__word_count')).count()
>
> We have enough information to be able to strip the pages join when using
> count() it certain conditions are met, and this might be preferable than
> adding workarounds to various places.
>

FYI: This had already been reported in #23771 (
https://code.djangoproject.com/ticket/23771) (and a couple of
similar/duplicates tickets)

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/CAO7PdF_Y_vQqYNst5ZR1d9vxWaZMqhZwfF3fcZ4PC7tQv0hGJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Optionally using a custom queryset for Paginator and MultipleObjectMixin (ListView)

2018-07-17 Thread Tom Forbes
Indeed, I had an attempt at doing this here (
https://github.com/django/django/pull/8928/), but it seems a hard problem.
I think there is huge potential here but I have no time to work on this
anymore.

On Tue, 17 Jul 2018, 19:00 Ramiro Morales,  wrote:

> On Sat, Jun 30, 2018 at 12:40 PM Tom Forbes  wrote:
>
>> Are you sure it is the prefetches that is causing this? As Adam pointed
>> out these are correctly ignored. Annotations however are not, which can
>> cause unnecessary work and longer execution times. i.e:
>>
>> Book.objects.annotate(something=Max('pages__word_count')).count()
>>
>> We have enough information to be able to strip the pages join when using
>> count() it certain conditions are met, and this might be preferable than
>> adding workarounds to various places.
>>
>
> FYI: This had already been reported in #23771 (
> https://code.djangoproject.com/ticket/23771) (and a couple of
> similar/duplicates tickets)
>
> Regards,
>
> --
> Ramiro Morales
> @ramiromorales
>
> --
> 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 django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> 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/CAO7PdF_Y_vQqYNst5ZR1d9vxWaZMqhZwfF3fcZ4PC7tQv0hGJw%40mail.gmail.com
> 
> .
> 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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/CAFNZOJOf-rN%3DMmOMTxjSEjjrC7FOGwuOLF7zXGqP79aeg0-68g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.