aboutsummaryrefslogtreecommitdiff
path: root/engine/schema
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-03 16:32:48 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-03 16:32:48 +0000
commit9539766a79716687877b2b383dd99e36482221bf (patch)
tree0758549b33217463ddb83e9811aefc2f9970b768 /engine/schema
parent004a0c8a75e8fb71b8ba0c47f000c381c03a2967 (diff)
downloadelgg-9539766a79716687877b2b383dd99e36482221bf.tar.gz
elgg-9539766a79716687877b2b383dd99e36482221bf.tar.bz2
Some missing keys added.
git-svn-id: https://code.elgg.org/elgg/trunk@2380 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/schema')
-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`);