aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/schema/mysql.sql8
-rw-r--r--engine/schema/upgrades/2008110301.sql17
2 files changed, 23 insertions, 2 deletions
diff --git a/engine/schema/mysql.sql b/engine/schema/mysql.sql
index 3277de23a..b906f9b5b 100644
--- a/engine/schema/mysql.sql
+++ b/engine/schema/mysql.sql
@@ -71,7 +71,9 @@ CREATE TABLE `prefix_entity_relationships` (
`relationship` varchar(50) NOT NULL,
`guid_two` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
- UNIQUE KEY (`guid_one`,`relationship`,`guid_two`)
+ UNIQUE KEY (`guid_one`,`relationship`,`guid_two`),
+ KEY `relationship` (`relationship`),
+ KEY `guid_two` (`guid_two`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
@@ -85,7 +87,9 @@ CREATE TABLE `prefix_access_collections` (
`owner_guid` bigint(20) unsigned NOT NULL,
`site_guid` bigint(20) unsigned NOT NULL default '0',
- PRIMARY KEY (`id`)
+ PRIMARY KEY (`id`),
+ KEY `owner_guid` (`owner_guid`),
+ KEY `site_guid` (`site_guid`)
) AUTO_INCREMENT=3 ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- Access containers
diff --git a/engine/schema/upgrades/2008110301.sql b/engine/schema/upgrades/2008110301.sql
new file mode 100644
index 000000000..8fd0539d2
--- /dev/null
+++ b/engine/schema/upgrades/2008110301.sql
@@ -0,0 +1,17 @@
+
+-- Based on slow query table feedback
+ALTER TABLE `prefix_entity_relationships` DROP KEY `relationship`;
+ALTER TABLE `prefix_entity_relationships` ADD KEY `relationship` (`relationship`);
+
+ALTER TABLE `prefix_entity_relationships` DROP KEY `guid_two`;
+ALTER TABLE `prefix_entity_relationships` ADD KEY `guid_two` (`guid_two`);
+
+-- The following seemed to have been missed off upgrade
+ALTER TABLE `prefix_users_entity` DROP KEY `code`;
+ALTER TABLE `prefix_users_entity` ADD KEY `code` (`code`);
+
+-- Access collections missing keys
+ALTER TABLE `prefix_access_collections` DROP KEY `site_guid`;
+ALTER TABLE `prefix_access_collections` ADD KEY `site_guid` (`site_guid`);
+ALTER TABLE `prefix_access_collections` DROP KEY `owner_guid`;
+ALTER TABLE `prefix_access_collections` ADD KEY `owner_guid` (`owner_guid`);