How your model relation look like? Maybe you face the N+1 problem, Do you 
check how many queries are performed during your website load? I agree with 
above:

- prefetch_related
- select_related
-cached_property

You can read this article, maybe it can help.

https://scoutapm.com/blog/django-and-the-n1-queries-problem

Best regards
Matt

czwartek, 11 lutego 2021 o 11:31:08 UTC+1 trapp...@gmail.com napisał(a):

> Also using caching will make a huge difference.
>
> Imagine that you stored all table rows in cache , you only need to rebuild 
> this cache tree every time you update a row or delete or add new row , you 
> update the cache tree.
>
> But a simple retrieve will come from cache not database , this will make a 
> huge difference
>
> On Wed, 10 Feb 2021, 4:34 pm carlos, <croch...@gmail.com> wrote:
>
>> Hi, read about this topics
>> https://docs.djangoproject.com/en/3.1/ref/models/querysets/#select-related  
>> #for FK relations
>>
>>
>> https://docs.djangoproject.com/en/3.1/ref/models/querysets/#prefetch-related-objects
>>   
>> # for M2M relations
>>
>> and read about pagination
>> https://docs.djangoproject.com/en/3.1/topics/pagination/
>>
>> maybe this 3 topics help you about optimization your applications
>>
>> Cheers
>>
>> On Wed, Feb 10, 2021 at 8:02 AM Mottaz Hegaze <trapp...@gmail.com> wrote:
>>
>>> Use pagination and select_related , prefetch_related.
>>>
>>> Also consider using caching
>>>
>>>  Default django pagination will load all rows then paginate them , which 
>>> will consume time and hits on database.
>>>
>>> Search for a custom pagination solution that loads 10 rows by 10 rows as 
>>> an example
>>>
>>> On Wed, 10 Feb 2021, 3:55 pm kévin endelin, <en2lin...@gmail.com> wrote:
>>>
>>>>
>>>> I am developing a django application, most of the views are tables, I 
>>>> am facing a problem the loading time of my page is extremely long. how 
>>>> can I do to optimize this, my data set represents more than 100,000 
>>>> rows. thank you for your help ^^ 
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to django-users...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/9a30277b-78d4-49c7-ac0a-399717ed7fe3n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/9a30277b-78d4-49c7-ac0a-399717ed7fe3n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAHV4E-fByf5F%2B-x_TN%2B0Uo_u5VwqZ2__ff-DP24jS9kNJJ07Kw%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/CAHV4E-fByf5F%2B-x_TN%2B0Uo_u5VwqZ2__ff-DP24jS9kNJJ07Kw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> att.
>> Carlos Rocha
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAM-7rO1A5hKPePy3zN2pPS9pfxLvQO-HK1XZW%2BZ1tVexo63TBA%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAM-7rO1A5hKPePy3zN2pPS9pfxLvQO-HK1XZW%2BZ1tVexo63TBA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22009090-b627-4bd0-80ca-c5dbd4af6b54n%40googlegroups.com.

Reply via email to