I'm debugging views leaking lots of memory in django 1.11. It looks like there is some connections with my usage of select_related(). But that's mail is not about that, not sure about my findings yet :)

So I have looked again at the select_related documentation here:

and found this:
Book.objects.select_related('author__hometown').get(id=4) will cache the related Person and the related City

Up until now i thought that only the related model i've specified would get added to selected columns e.g. only the City because of hometown. But it looks that's not how it is :)

Would it make sense to add a parameter to change select_related behaviour to include only the columns of the related models specified? That could save quite a lot of bandwitdh for some use cases.

What do you think?


Riccardo Magliocchetti


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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to