diff options
author | Andreas Fischer <bantu@phpbb.com> | 2009-12-08 03:53:41 +0000 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2009-12-08 03:53:41 +0000 |
commit | ccc774412e69ceb73f8cbc82cb842860389cb7de (patch) | |
tree | 6b1c80f3a606b9520f735817f61948e266360e9a | |
parent | 57f71690e3c68c6d6888e07abf33f060e94bfa25 (diff) | |
download | forums-ccc774412e69ceb73f8cbc82cb842860389cb7de.tar forums-ccc774412e69ceb73f8cbc82cb842860389cb7de.tar.gz forums-ccc774412e69ceb73f8cbc82cb842860389cb7de.tar.bz2 forums-ccc774412e69ceb73f8cbc82cb842860389cb7de.tar.xz forums-ccc774412e69ceb73f8cbc82cb842860389cb7de.zip |
Optimize SQL queries 'a little'.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10304 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/feed.php | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php index 79848437c5..ef1bfd48d1 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -722,7 +722,7 @@ class phpbb_feed 'SELECT' => 'f.forum_id, f.forum_name, f.forum_desc_options, ' . 't.topic_last_post_time, t.topic_id, t.topic_title, t.topic_time, t.topic_replies, t.topic_views, ' . 'p.post_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . - 'u.username, u.user_id, u.user_email, u.user_colour', + 'u.username, u.user_id', 'FROM' => array( POSTS_TABLE => 'p', TOPICS_TABLE => 't', @@ -933,20 +933,17 @@ class phpbb_feed_news extends phpbb_feed // Build SQL Query $this->sql = array( - 'SELECT' => 'f.forum_id, f.forum_password, f.forum_name, f.forum_topics, f.forum_posts, f.parent_id, f.left_id, f.right_id, + 'SELECT' => 'f.forum_id, f.forum_name, f.forum_topics, f.forum_posts, t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time, - p.post_id, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, - u.username, u.user_id, u.user_email, u.user_colour', + p.post_id, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( TOPICS_TABLE => 't', FORUMS_TABLE => 'f', POSTS_TABLE => 'p', - USERS_TABLE => 'u', ), 'WHERE' => $db->sql_in_set('t.forum_id', $in_fid_ary) . ' AND f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id - AND t.topic_poster = u.user_id AND t.topic_moved_id = 0', 'ORDER_BY' => 't.topic_time DESC', ); @@ -1033,20 +1030,17 @@ class phpbb_feed_topics extends phpbb_feed } $this->sql = array( - 'SELECT' => 'f.forum_id, f.forum_password, f.forum_name, f.forum_topics, f.forum_posts, f.parent_id, f.left_id, f.right_id, + 'SELECT' => 'f.forum_id, f.forum_name, f.forum_topics, f.forum_posts, t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time, - p.post_id, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, - u.username, u.user_id, u.user_email, u.user_colour', + p.post_id, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( TOPICS_TABLE => 't', FORUMS_TABLE => 'f', POSTS_TABLE => 'p', - USERS_TABLE => 'u', ), 'WHERE' => $db->sql_in_set('p.post_id', $post_ids) . ' AND f.forum_id = p.forum_id - AND t.topic_id = p.topic_id - AND u.user_id = p.poster_id', + AND t.topic_id = p.topic_id', 'ORDER_BY' => 't.topic_last_post_time DESC', ); |