summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2012-02-01 14:12:45 (GMT)
committer Gábor Hojtsy2012-02-01 14:12:45 (GMT)
commit9f4bd9bddb18cca9b76fb842eeb985deda97fb43 (patch)
treeb175859bf442e1853831abc5919aaad16ab64638
parent0333313bed4e4b77029ae9af0be49f5f457072ed (diff)
Issue #289504 by mikeryan, catch, moshe weitzman: backport indexes from Drupal 7 on comments and node_comment_statistics to improve performance of mass-user operations such as deleting users en masse
-rw-r--r--modules/comment/comment.install13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 19aa640..b129299 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -81,6 +81,16 @@ function comment_update_6004() {
}
/**
+ * Add indices to uid fields.
+ */
+function comment_update_6005() {
+ $ret = array();
+ db_add_index($ret, 'comments', 'comment_uid', array('uid'));
+ db_add_index($ret, 'node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-6.x-extra"
* The next series of updates should start at 7000.
*/
@@ -185,6 +195,7 @@ function comment_schema() {
'indexes' => array(
'pid' => array('pid'),
'nid' => array('nid'),
+ 'comment_uid' => array('uid'),
'status' => array('status'), // This index is probably unused
),
'primary key' => array('cid'),
@@ -230,9 +241,9 @@ function comment_schema() {
'indexes' => array(
'node_comment_timestamp' => array('last_comment_timestamp'),
'comment_count' => array('comment_count'),
+ 'last_comment_uid' => array('last_comment_uid'),
),
);
return $schema;
}
-