I'm using orm query fetching all data and showing into html templates ,
it's taking more time for get the data ,

On Tue, Jan 17, 2023, 12:40 PM Clive Bruton <cl...@indx.co.uk> wrote:

>
> On 17 Jan 2023, at 05:01, Prashanth Patelc wrote:
>
> > I written query it's taking more time like 38 seconds, how to to
> > fetch the lac of records within seconds any example in django using
> > orm or MySQL query ?
>
> Are you saying that you have a raw SQL query, or you are using a
> Django query?
>
> My experience is that the biggest lag in database retrieval is the
> amount of data retrieved, so if you can reduce the number of fields
> returned, that would be a good start.
>
> If you are using a Django query, and it has related elements, then
> the biggest boost you can give is using "select_related" and
> "prefetch_related".
>
>
> -- Clive
>
> --
> 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/9EF46118-6870-46AD-BF58-12AEC8C6A518%40indx.co.uk
> .
>

-- 
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/CAMCU6CrAKQL6qA6hWHPDFbfpCT1R9v5%2BY_Qi-HOkPf%3DOXYt2yA%40mail.gmail.com.

Reply via email to