diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-03-07 23:27:14 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-03-07 23:27:14 +0000 |
commit | 29dc1d64e1631678ced41616ba95a9fac2643878 (patch) | |
tree | 14d22cbd9407384b16642c736242b0eec3dd1b5a /modules/comment/comment.install | |
parent | 58e98669a0689c6d31ef7b78e5e4dc84fdae511e (diff) | |
download | brdo-29dc1d64e1631678ced41616ba95a9fac2643878.tar.gz brdo-29dc1d64e1631678ced41616ba95a9fac2643878.tar.bz2 |
- Patch #734750 by Damien Tournoud: unnecessary belly-dancing about indexes on {comment}.
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r-- | modules/comment/comment.install | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 0ef098a78..7b486b493 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -140,16 +140,6 @@ function comment_update_7002() { } /** - * Improve indexes on the comment table. - */ -function comment_update_7003() { - db_drop_index('comment', 'status'); - db_drop_index('comment', 'pid'); - db_add_index('comment', 'comment_pid_status', array('pid', 'status')); - db_add_index('comment', 'comment_num_new', array('nid', 'timestamp', 'status')); -} - -/** * Rename comment display setting variables. */ function comment_update_7004() { @@ -183,11 +173,12 @@ function comment_update_7006() { } /** - * Split {comment}.timestamp into {comment}.created and {comment}.changed. + * Split {comment}.timestamp into 'created' and 'changed', improve indexing on {comment}. */ function comment_update_7007() { - // Drop the index associated to timestamp. - db_drop_index('comment', 'comment_num_new'); + // Drop the old indexes. + db_drop_index('comment', 'status'); + db_drop_index('comment', 'pid'); // Create a created column. db_add_field('comment', 'created', array( @@ -203,12 +194,15 @@ function comment_update_7007() { 'default' => 0, )); - // Recreate the index. - db_add_index('comment', 'comment_num_new', array('nid', 'changed', 'status')); - // Migrate the data. // @todo db_update() should support this. db_query('UPDATE {comment} SET created = changed'); + + // Recreate the indexes. + // The 'comment_num_new' index is optimized for comment_num_new() + // and comment_new_page_count(). + db_add_index('comment', 'comment_num_new', array('nid', 'status', 'created', 'cid', 'thread')); + db_add_index('comment', 'comment_pid_status', array('pid', 'status')); } /** @@ -352,14 +346,6 @@ function comment_update_7013(&$sandbox) { } /** - * Optimize index for comment_num_new() and comment_new_page_count(). - */ -function comment_update_7014() { - db_drop_index('comment', 'comment_num_new'); - db_add_index('comment', 'comment_num_new', array('nid', 'status', 'created', 'cid', 'thread')); -} - -/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ |