Commit 88884f89 authored by webchick's avatar webchick

#289504 by mikeryan and moshe weitzman: Add index on comment, uid columns to...

#289504 by mikeryan and moshe weitzman: Add index on comment, uid columns to speed up user_delete().
parent ce3fce34
......@@ -137,6 +137,28 @@ function comment_update_7004() {
return array();
}
/**
* 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment