diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-01 09:12:19 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-01 09:12:19 -0800 |
commit | 4c8c6eefb87a2c385a9b9a4960ec59f98c91228b (patch) | |
tree | 7d6edcc682e4c331325feb2065c3473f7c0fe11a /modules/comment | |
parent | df99795a5d7a2cbaa50c2bedcf6fa8420092ebef (diff) | |
download | brdo-4c8c6eefb87a2c385a9b9a4960ec59f98c91228b.tar.gz brdo-4c8c6eefb87a2c385a9b9a4960ec59f98c91228b.tar.bz2 |
Issue #336483 by brianV, catch: Fixed Performance: SELECT MAX(comment_count()) FROM node_comment_statistics() does full table scan.
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.install | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index d4bf76f93..7312e2a31 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -226,8 +226,11 @@ function comment_update_7004() { )); db_add_index('node_comment_statistics', 'cid', array('cid')); - // Add an index on the comment_count. - db_add_index('node_comment_statistics', 'comment_count', array('comment_count')); + // The comment_count index may have been added in Drupal 6. + if (!db_index_exists('node_comment_statistics', 'comment_count')) { + // Add an index on the comment_count. + db_add_index('node_comment_statistics', 'comment_count', array('comment_count')); + } } /** |