summaryrefslogtreecommitdiff
path: root/modules/system/system.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-03-30 08:47:58 +0000
committerDries Buytaert <dries@buytaert.net>2007-03-30 08:47:58 +0000
commit8018fe942d74ce503b476073413507c66eb0bda0 (patch)
tree2c4dff2636021a33517ac15a8c6521de6413efe0 /modules/system/system.install
parent9e94bb610136ceb8cfedf2cc139c4b34ed7a46c4 (diff)
downloadbrdo-8018fe942d74ce503b476073413507c66eb0bda0.tar.gz
brdo-8018fe942d74ce503b476073413507c66eb0bda0.tar.bz2
- Patch #131934 by Gerhard: removed useless indices.
Diffstat (limited to 'modules/system/system.install')
-rw-r--r--modules/system/system.install29
1 files changed, 22 insertions, 7 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index e4223a9f8..72b631a6e 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -485,10 +485,7 @@ function system_install() {
totalcount bigint unsigned NOT NULL default '0',
daycount mediumint unsigned NOT NULL default '0',
timestamp int unsigned NOT NULL default '0',
- PRIMARY KEY (nid),
- KEY totalcount (totalcount),
- KEY daycount (daycount),
- KEY timestamp (timestamp)
+ PRIMARY KEY (nid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {system} (
@@ -976,9 +973,6 @@ function system_install() {
timestamp int_unsigned NOT NULL default '0',
PRIMARY KEY (nid)
)");
- db_query("CREATE INDEX {node_counter}_totalcount_idx ON {node_counter} (totalcount)");
- db_query("CREATE INDEX {node_counter}_daycount_idx ON {node_counter} (daycount)");
- db_query("CREATE INDEX {node_counter}_timestamp_idx ON {node_counter} (timestamp)");
db_query("CREATE TABLE {system} (
filename varchar(255) NOT NULL default '',
@@ -3709,6 +3703,27 @@ function system_update_2005() {
}
/**
+ * Drop useless indices on node_counter table.
+ */
+function system_update_2006() {
+ $ret = array();
+ switch ($GLOBALS['db_type']) {
+ case 'pgsql':
+ $ret[] = update_sql('DROP INDEX {node_counter}_daycount_idx');
+ $ret[] = update_sql('DROP INDEX {node_counter}_totalcount_idx');
+ $ret[] = update_sql('DROP INDEX {node_counter}_timestamp_idx');
+ break;
+ case 'mysql':
+ case 'mysqli':
+ $ret[] = update_sql("ALTER TABLE {node_counter} DROP INDEX daycount");
+ $ret[] = update_sql("ALTER TABLE {node_counter} DROP INDEX totalcount");
+ $ret[] = update_sql("ALTER TABLE {node_counter} DROP INDEX timestamp");
+ break;
+ }
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-5.0-to-x.x"
* The next series of updates should start at 3000.
*/