From 44a4cfebcdc692ee54315bc4a18d7335d9847083 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 15 Jun 2009 19:28:55 +0000 Subject: - Patch #243093 by catch, killes: improved indices on comment table. --- modules/comment/comment.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index a1e36a90f..3e6fb15eb 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1335,7 +1335,7 @@ function comment_num_new($nid, $timestamp = 0) { $timestamp = ($timestamp > NODE_NEW_LIMIT ? $timestamp : NODE_NEW_LIMIT); // Use the timestamp to retrieve the number of new comments. - return db_query('SELECT COUNT(c.cid) FROM {node} n INNER JOIN {comment} c ON n.nid = c.nid WHERE n.nid = :nid AND timestamp > :timestamp AND c.status = :status', array( + return db_query('SELECT COUNT(cid) FROM {comment} WHERE nid = :nid AND timestamp > :timestamp AND status = :status', array( ':nid' => $nid, ':timestamp' => $timestamp, ':status' => COMMENT_PUBLISHED, -- cgit v1.2.3