summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2012-02-01 13:40:53 (GMT)
committer Gábor Hojtsy2012-02-01 13:40:53 (GMT)
commit072a563ceb0d2b0822744be08b273f8dfbe8e451 (patch)
tree0386bdf999ffb750db970c7d7165a2d973b07718
parent6c06f77c90fcf98ea2e98c30eed491be9b08e6c6 (diff)
Issue #336483 by brianV, catch: add index for comment_count on column in node_comment_statistics to avoid full table scan when search index is updated for example
-rw-r--r--modules/comment/comment.install22
1 files changed, 21 insertions, 1 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index e5ac7d0..19aa640 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -66,6 +66,25 @@ function comment_update_6003() {
return $ret;
}
+/**
+ * @defgroup updates-6.x-extra Extra system updates for 6.x
+ * @{
+ */
+
+/**
+ * Add index to to node_comment_statistics on comment_count
+ */
+function comment_update_6004() {
+ $ret = array();
+ db_add_index($ret, 'node_comment_statistics', 'comment_count', array('comment_count'));
+ return $ret;
+}
+
+/**
+ * @} End of "defgroup updates-6.x-extra"
+ * The next series of updates should start at 7000.
+ */
+
/**
* Implementation of hook_schema().
@@ -209,7 +228,8 @@ function comment_schema() {
),
'primary key' => array('nid'),
'indexes' => array(
- 'node_comment_timestamp' => array('last_comment_timestamp')
+ 'node_comment_timestamp' => array('last_comment_timestamp'),
+ 'comment_count' => array('comment_count'),
),
);