diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-06-15 19:28:55 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-06-15 19:28:55 +0000 |
commit | 44a4cfebcdc692ee54315bc4a18d7335d9847083 (patch) | |
tree | 1b5d2601b6aeb0fe77c07a77d73979b70ea0dc7d /modules/comment/comment.install | |
parent | b0ebab68ca250eac7c83a3dabdec7eef7ff39641 (diff) | |
download | brdo-44a4cfebcdc692ee54315bc4a18d7335d9847083.tar.gz brdo-44a4cfebcdc692ee54315bc4a18d7335d9847083.tar.bz2 |
- Patch #243093 by catch, killes: improved indices on comment table.
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r-- | modules/comment/comment.install | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 119e96a9c..d98ba0ce8 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -154,6 +154,18 @@ function comment_update_7002() { } /** + * Improve indexes on the comment table. + */ +function comment_update_7003() { + $ret = array(); + db_drop_index($ret, 'comment', 'status'); + db_drop_index($rest, 'comment', 'pid'); + db_add_index($ret, 'comment', 'comment_pid_status', array('pid', 'status')); + db_add_index($ret, 'comment', 'comment_num_new', array('nid', 'timestamp', 'status')); + return $ret; +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ @@ -255,10 +267,8 @@ function comment_schema() { ) ), 'indexes' => array( - 'pid' => array('pid'), - 'nid' => array('nid'), - // This index is probably unused. - 'status' => array('status'), + 'comment_status_pid' => array('pid', 'status'), + 'comment_num_new' => array('nid', 'timestamp', 'status'), ), 'primary key' => array('cid'), 'foreign keys' => array( |