I have a page that needs to get a few values via the aggregate
function of querysets. There are about 15 of them, and they all look
like this:

SELECT SUM(some_column_name) FROM ...

and they each take a few hundred milliseconds each. That makes the
page take a lot longer to render than I'd like. I'm thinking of
refactoring so it gets those values after the page renders via an Ajax
call.

Also, instead of having each one call it's own query, I'm thinking of
having each ajax call call one query like so:

SELECT SUM(column1), SUM(column2), ...

and take advantage of the fact that the above query is going to be
quicker than doing each one individually in database terms. Also,
doesn't django cache querysets? Does it cache them between requests?
Will the cache expire once the response is returned?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to