On Wed, Mar 23, 2011 at 1:35 PM, Brian Neal <bgn...@gmail.com> wrote:
> So you are suggesting I need to shrink the number of topics or
> possibly link the posts directly to the forum?

right.  since you only want the 30 latest posts, scanning 12k topics
is absurd.  i guess just ordering by (topic.update_date DESC,
post_creationdate DESC) would allow the server to stop searching as
soon as it has the required 30 posts.

just be sure to have an index on topic.update_date

the second choice, linking the post to the forum would let the server
to do the scan based on post, not on topic, likely eliminating the
need for the temporary table

-- 
Javier

-- 
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.

Reply via email to