From 235a39e589ae4a161beed48758bb160a215a1d05 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 20 May 2005 11:04:06 +0000 Subject: - Removing the /*! USE INDEX */. It actually degrades performance significantly. --- modules/forum/forum.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/forum') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 83ffbf313..9b75862c7 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -633,7 +633,7 @@ function forum_get_forums($tid = 0) { // This query does not use full ANSI syntax since MySQL 3.x does not support // table1 INNER JOIN table2 INNER JOIN table3 ON table2_criteria ON table3_criteria // used to join node_comment_statistics to users. - $sql = "SELECT n.nid, l.last_comment_timestamp, IF(l.last_comment_uid, cu.name, l.last_comment_name) as last_comment_name, l.last_comment_uid FROM {node} n, {node_comment_statistics} l /*! USE INDEX (node_comment_timestamp) */, {users} cu, {term_node} r WHERE n.nid = r.nid AND r.tid = %d AND n.status = 1 AND n.type = 'forum' AND l.last_comment_uid = cu.uid AND n.nid = l.nid ORDER BY l.last_comment_timestamp DESC"; + $sql = "SELECT n.nid, l.last_comment_timestamp, IF(l.last_comment_uid, cu.name, l.last_comment_name) as last_comment_name, l.last_comment_uid FROM {node} n, {node_comment_statistics} l, {users} cu, {term_node} r WHERE n.nid = r.nid AND r.tid = %d AND n.status = 1 AND n.type = 'forum' AND l.last_comment_uid = cu.uid AND n.nid = l.nid ORDER BY l.last_comment_timestamp DESC"; $sql = db_rewrite_sql($sql); $topic = db_fetch_object(db_query_range($sql, $forum->tid, 0, 1)); -- cgit v1.2.3