Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-14 Thread Miika Huusko
ed update also to Stack Overflow: https://stackoverflow.com/questions/44461638/django-django-rest-framework-postgresql-queries-and-serialization-is-very-sl Thanks for help. On Sunday, June 11, 2017 at 5:57:22 PM UTC+3, Miika Huusko wrote: > > I have a performance problem with Dja

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
t;Photos". JOIN could be done with hashes or IDs. Either way it would be customer who would make the JOIN. I might go there, but still I don't believe that Django could not handle my meager data faster than 20 seconds :) If that would be the case it really would be sad. On Sunday, Ju

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
There must be some kind of extra looping or cloning going on when performing Python level JOIN for prefetched Photos or other related sets. On Sunday, June 11, 2017 at 4:57:22 PM UTC+2, Miika Huusko wrote: > > I have a performance problem with Django + Django REST Framework. The > probl

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
in. Is there something one should consider when making related items like Photos and Events related to Items? That use case is quite simple and still result Django to use 18 seconds to process SQL query response. There is lot of data of course, but I have thought that returning 50k objects should no

Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
I have a performance problem with Django + Django REST Framework. The problem is that it takes Django very, very long time to handle SQL query response + DRF serialization take quite some time also. It happens when there are ManyToMany or OneToMany relations and nested objects. Sounds like "N +