From b9b4dfb68d50a0416001665d72b14c26bd8b3235 Mon Sep 17 00:00:00 2001
From: raylu <raylu@gridium.com>
Date: Thu, 24 Oct 2013 23:31:19 -0700
Subject: speed up homepage and kill_list

get rid of filesorts
---
 db/schema.sql | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index af21bf5..47102ca 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -31,11 +31,11 @@ CREATE TABLE `characters` (
 	`weapon_type_id` int DEFAULT NULL,
 	PRIMARY KEY (`id`),
 	CONSTRAINT `fk_char_km` FOREIGN KEY (`kill_id`) REFERENCES `kills` (`kill_id`),
-	INDEX `character_id` (`character_id`),
+	INDEX `character_id_kill_id` (`character_id`, `kill_id`),
+	INDEX `alliance_id_kill_id` (`alliance_id`, `kill_id`),
+	INDEX `corporation_id_kill_id` (`corporation_id`, `kill_id`),
 	INDEX `character_name` (`character_name`),
-	INDEX `alliance_id` (`alliance_id`),
 	INDEX `alliance_name` (`alliance_name`),
-	INDEX `corporation_id` (`corporation_id`),
 	INDEX `corporation_name` (`corporation_name`),
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
@@ -61,5 +61,6 @@ CREATE TABLE `kill_costs` (
 	`kill_id` int unsigned NOT NULL UNIQUE,
 	`cost` bigint unsigned NOT NULL,
 	PRIMARY KEY (`kill_id`),
+	INDEX `cost_kill_id` (`cost`, `kill_id`),
 	CONSTRAINT `fk_kill_cost_km` FOREIGN KEY (`kill_id`) REFERENCES `kills` (`kill_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- 
cgit v1.2.3

