Query Optimize help

I am running slow-queries option set to 5 and notice the follwing query repeatedly pop up:

# Time: 050615 11:37:50
# User@Host: l2fca_pnke1[l2fca_pnke1] @ localhost []
# Query_time: 6 Lock_time: 0 Rows_sent: 10 Rows_examined: 104074
SELECT nuke_phpbb_topics.topic_title,
nuke_phpbb_topics.topic_replies,
nuke_phpbb_topics.topic_views,
nuke_phpbb_topics.topic_id,
nuke_phpbb_users.username,
nuke_phpbb_posts.post_id,
nuke_phpbb_posts.poster_id,
nuke_phpbb_posts.post_time,
nuke_phpbb_posts_text.post_subject,
nuke_phpbb_forums.forum_id,
nuke_phpbb_forums.forum_name,
nuke_phpbb_categories.cat_title
FROM ((nuke_phpbb_topics
INNER JOIN nuke_phpbb_posts ON nuke_phpbb_topics.topic_id = nuke_phpbb_posts.topic_id)
INNER JOIN nuke_phpbb_users ON nuke_phpbb_users.user_id = nuke_phpbb_posts.poster_id)
INNER JOIN nuke_phpbb_posts_text ON nuke_phpbb_posts_text.post_id = nuke_phpbb_posts.post_id
INNER JOIN nuke_phpbb_forums ON nuke_phpbb_forums.forum_id = nuke_phpbb_topics.forum_id
INNER JOIN nuke_phpbb_categories ON nuke_phpbb_categories.cat_id = nuke_phpbb_forums.cat_id
WHERE (nuke_phpbb_forums.auth_view <= 1 OR (nuke_phpbb_forums.auth_view = 2 AND nuke_phpbb_topics.forum_id IN (2, 5, 7, 10, 11, 12, 13, 16,
18, 19, 21, 23, 24)) )
AND (nuke_phpbb_forums.auth_read <= 1 OR (nuke_phpbb_forums.auth_read = 2 AND nuke_phpbb_topics.forum_id IN (2, 5, 7, 10, 11, 12, 13, 16,
18, 19, 21, 23, 24)) ) AND nuke_phpbb_forums.forum_id NOT IN (14)
AND nuke_phpbb_topics.topic_status <> 2
ORDER BY post_time DESC LIMIT 10;

A explain on the query shows:

+-----------------------+--------+------------------------------------------------------------------------+---------+---------+-------------------------------+-------+---------------------------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-----------------------+--------+------------------------------------------------------------------------+---------+---------+-------------------------------+-------+---------------------------------+
| nuke_phpbb_posts_text | ALL | PRIMARY | NULL | NULL | NULL | 15758 | Using temporary; Using filesort |
| nuke_phpbb_posts | eq_ref | PRIMARY,topic_id,poster_id | PRIMARY | 3 | nuke_phpbb_posts_text.post_id | 1 | |
| nuke_phpbb_users | eq_ref | PRIMARY | PRIMARY | 3 | nuke_phpbb_posts.poster_id | 1 | |
| nuke_phpbb_topics | eq_ref | PRIMARY,forum_id | PRIMARY | 3 | nuke_phpbb_posts.topic_id | 1 | Using where |
| nuke_phpbb_forums | eq_ref | PRIMARY,cat_id,auth_view,auth_read,auth_read_2,auth_read_3,auth_view_2 | PRIMARY | 2 | nuke_phpbb_topics.forum_id | 1 | Using where |
| nuke_phpbb_categories | eq_ref | PRIMARY | PRIMARY | 3 | nuke_phpbb_forums.cat_id | 1 | |
+-----------------------+--------+------------------------------------------------------------------------+---------+---------+-------------------------------+-------+---------------------------------+
Is there anything I can do to the query to make it use the primary key?? It seems post_text is the culprit ...

 

 

 

 

Top