"But the CPU usage and time taken are high" <- I'm assuming high enough to be problematic for OP.
I'm seriously not following. Why are people suggesting reporting and export software when OP hasn't even described the problem in detail. It's not even clear whether the high cpu and time taken are due to the basic query ("Model.objects.all()") or the further processing of the report. It could easily be a missing "select_related" which causes thousands of joins inside a for loop. On 3/11/17, James Schneider <jrschneide...@gmail.com> wrote: > On Mar 11, 2017 12:01 PM, "Vijay Khemlani" <vkhem...@gmail.com> wrote: > > Am I the only one who thinks that generating a report over a set of > just 10.000 records could be done in 10 - 20 secs unless there are > some serious computations going on with that data? > > For a report I have to query around 200.000 records, with > aggregations, and it takes less than a minute using the ORM. > > > The OP never mentioned a time interval that I can find in this thread, only > CPU utilization. I can only imagine that the query is taking long enough to > notice the CPU utilization, which would be at least a few seconds. > > Querying and aggregating 200K records within the DB is not comparable to > pulling 10K individual records and performing processing on each one. An > ORM call with aggregation will perform a large majority of the work in the > DB, and the ORM simply wraps the response accordingly. > > -James > > -- > 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 post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWZFoHQD%3D9UpSQzmpzO70_7MXuw6J01myYrAQ4ZN-uX4g%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 users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei3kzzz7XcN4m8DzBO5cAyr9PNhCsw4C_6aRCdk4iVYj7g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.