#289504 by mikeryan and moshe weitzman: Add index on comment, uid columns to speed up user_delete().
parent
ce3fce3491
commit
88884f89c1
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue