Hi, As Samuel said, the first step is to install Django Debug Toolbar to see what's going on with your queries. Then you'll probably be interested in https://docs.djangoproject.com/en/1.4/ref/models/querysets/#prefetch-related
Regards, Xavier Ordoquy, Linovia. Le 20 oct. 2012 à 05:16, Barry Morrison <bdmorri...@gmail.com> a écrit : > I've got a pretty expensive query...Wondering if I can't speed things up in > regards to Postgresql. > > Here is the model: [1] http://dpaste.org/JmEeQ/ > > Here is the sql statement: [2] http://dpaste.org/GbfAJ/ > > Here is the template: [3] http://dpaste.org/vxRs4/ > > Here is the 'guts' of the view: [4] http://dpaste.org/w0b2z/ > > Total Postgresql/SQL n00b, so this may be a stupid statement. I'm wondering > if an index on '"press_page"."article_id"' wouldn't speed things up a bit? > > In dev, I don't have the amount of data that exists in production, so I can't > easily/realistically recreate this scenario. > > FWIW, I'm running: > > Django 12.04 > Postgresql 9.1.5 > Django 1.4.1 > I'm using memcache on the view to cache it, it helped take page load down > significantly, but I was wondering if there wasn't something I could do from > the DB side of things since I know it's this query that is taking the page so > long to load. > > Thanks! > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/U92OjnMgEggJ. > 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. -- 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.