diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-03-07 12:57:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-03-07 12:57:50 +0000 |
commit | 9f91274a5bddeba6c2afb49c81b84402d00e2df8 (patch) | |
tree | ae26b48ba635be9ea14fb84c68a30d9765851f73 /modules/system/system.install | |
parent | 0340d4d503c32e0435e122d11c042fd0634ec330 (diff) | |
download | brdo-9f91274a5bddeba6c2afb49c81b84402d00e2df8.tar.gz brdo-9f91274a5bddeba6c2afb49c81b84402d00e2df8.tar.bz2 |
- Patch #118712 by mindless: add index on comment.status.
Diffstat (limited to 'modules/system/system.install')
-rw-r--r-- | modules/system/system.install | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index fb35dcc6b..5effa4410 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -263,7 +263,8 @@ function system_install() { mail varchar(64) default NULL, homepage varchar(255) default NULL, PRIMARY KEY (cid), - KEY lid (nid) + KEY lid (nid), + KEY status (status) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); db_query("CREATE TABLE {node_comment_statistics} ( @@ -739,6 +740,7 @@ function system_install() { PRIMARY KEY (cid) )"); db_query("CREATE INDEX {comments}_nid_idx ON {comments} (nid)"); + db_query("CREATE INDEX {comments}_status_idx ON {comments} (status)"); db_query("CREATE TABLE {node_comment_statistics} ( nid serial CHECK (nid >= 0), @@ -3596,6 +3598,24 @@ function system_update_2002() { } /** + * Add index on comments status column. + */ +function system_update_2003() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql('ALTER TABLE {comments} ADD KEY status (status)'); + break; + + case 'pgsql': + $ret[] = update_sql("CREATE INDEX {comments}_status_idx ON {comments} (status)"); + break; + } + return $ret; +} + +/** * @} End of "defgroup updates-5.0-to-x.x" * The next series of updates should start at 3000. */ |