On Dec 1, 1:57 pm, stargazer <stranger....@gmail.com> wrote: > Hi all, > > I'm trying the famous Django > tutorial:http://docs.djangoproject.com/en/1.1/intro/ > > Playing with "polls" and "choices" I see lot of SQL queries this > application creates. Actually, I just selected a list of polls > than selected the poll with ID=2, than voted for a choice. > Here are details (SQL's recorded using "debug_toolbar", may be a > database log will show something else): <snip> > It seems, same records are selected several time. > With some sort of caching this could be greatly improved. > > May be some built-in Django tools (like select_related()? ) can help > here? > > I now, number of cache implementations exists > (like thishttp://github.com/mmalone/django-caching/ and > thishttp://github.com/dcramer/django-orm-cache) > but I would like to use built-in Django instruments first.
Caching isn't the issue here, it's a matter of writing the queries properly. Yes, select_related will help. But you can't expect the tutorial to explain these concepts - it's supposed to be a very basic introduction to using Django, and doesn't go into detail. The full explanation of how to make queries is in the actual documentation. -- DR. -- 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.