Friday, October 19, 2012

Postgresql Index & expensive queries [n00bie alert]

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate