On Thu, 2009-03-12 at 18:57 -0700, adrian wrote: > > I have users with 30K rows in the database and have to support various > types of queries, some of which > require raw SQL. I used a two-step approach to get the query_set, > first do a raw SQL query to get a list of the ids of the rows I need, > then filter the queryset with it. > > This isn't terribly fast but may be ok if it only happens once per > result set. > But now I'm trying to paginate the results and finding that Django > does the entire query sequence over again for each page. Is there > some way to avoid this, using memcache perhaps?
The Django itself isn't going to avoid it automatically, since it's a "shared nothing" system: each request is indepdendent. However, there is, as you note, the caching framework available. So if you want to cache something, just do it. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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 -~----------~----~----~----~------~----~------~--~---