summaryrefslogtreecommitdiff
path: root/modules/comment/comment.install
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-09 02:46:27 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-09 02:46:27 +0000
commit88884f89c11d27a29fe85d9debeef1f430e12f59 (patch)
tree31131cdfd65fffd76d8689a6e41138aed766f0d9 /modules/comment/comment.install
parentce3fce3491dd897488f763fe45e883658d023e75 (diff)
downloadbrdo-88884f89c11d27a29fe85d9debeef1f430e12f59.tar.gz
brdo-88884f89c11d27a29fe85d9debeef1f430e12f59.tar.bz2
#289504 by mikeryan and moshe weitzman: Add index on comment, uid columns to speed up user_delete().
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r--modules/comment/comment.install38
1 files changed, 26 insertions, 12 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 61ca2d14a..725793099 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -138,6 +138,28 @@ function comment_update_7004() {
}
/**
+ * Create comment Field API bundles.
+ */
+function comment_update_7005() {
+ $ret = array();
+
+ foreach (node_type_get_types() as $info) {
+ field_attach_create_bundle('comment_node_' . $info->type);
+ }
+ return $ret;
+}
+
+/**
+ * Create user related indexes.
+ */
+function comment_update_7006() {
+ $ret = array();
+ db_add_index($ret, 'comment', '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-to-7.x"
* The next series of updates should start at 8000.
*/
@@ -241,10 +263,12 @@ function comment_schema() {
'indexes' => array(
'comment_status_pid' => array('pid', 'status'),
'comment_num_new' => array('nid', 'timestamp', 'status'),
+ 'comment_uid' => array('uid'),
),
'primary key' => array('cid'),
'foreign keys' => array(
'nid' => array('node' => 'nid'),
+ 'uid' => array('users' => 'uid'),
),
);
@@ -288,23 +312,13 @@ function comment_schema() {
'indexes' => array(
'node_comment_timestamp' => array('last_comment_timestamp'),
'comment_count' => array('comment_count'),
+ 'last_comment_uid' => array('last_comment_uid'),
),
'foreign keys' => array(
'nid' => array('node' => 'nid'),
+ 'last_comment_uid' => array('users' => 'uid'),
),
);
return $schema;
-}
-
-/**
- * Create comment Field API bundles.
- */
-function comment_update_7005() {
- $ret = array();
-
- foreach (node_type_get_types() as $info) {
- field_attach_create_bundle('comment_node_' . $info->type);
- }
- return $ret;
} \ No newline at end of file