--- a/install/schemas/upgrade/1.1.5-1.1.6-mysql.sql Thu Apr 16 00:53:05 2009 -0400
+++ b/install/schemas/upgrade/1.1.5-1.1.6-mysql.sql Thu Apr 16 00:55:13 2009 -0400
@@ -25,3 +25,17 @@
ALTER TABLE {{TABLE_PREFIX}}tags MODIFY COLUMN page_id varchar(512) NOT NULL,
MODIFY COLUMN namespace varchar(16) NOT NULL;
+
+-- Added in 1.1.6: Indices for several tables
+-- The size of 317 is a trial-and-error-produced value based on MySQL's index column size limit
+-- of 1000 bytes. It's low like that because of the UTF-8 character set being used.
+
+@ALTER TABLE {{TABLE_PREFIX}}logs ADD INDEX {{TABLE_PREFIX}}logs_page_idx (page_id(317), namespace);
+@ALTER TABLE {{TABLE_PREFIX}}logs ADD INDEX {{TABLE_PREFIX}}logs_time_idx (time_id);
+@ALTER TABLE {{TABLE_PREFIX}}logs ADD INDEX {{TABLE_PREFIX}}logs_action_idx (log_type, action);
+@ALTER TABLE {{TABLE_PREFIX}}comments ADD INDEX {{TABLE_PREFIX}}comments_page_idx (page_id(317), namespace);
+@ALTER TABLE {{TABLE_PREFIX}}hits ADD INDEX {{TABLE_PREFIX}}hits_time_idx ( time );
+@ALTER TABLE {{TABLE_PREFIX}}hits ADD INDEX {{TABLE_PREFIX}}hits_page_idx (page_id(317), namespace);
+@ALTER TABLE {{TABLE_PREFIX}}pages ADD INDEX {{TABLE_PREFIX}}pages_page_idx (urlname(317), namespace);
+@ALTER TABLE {{TABLE_PREFIX}}page_text ADD INDEX {{TABLE_PREFIX}}page_text_page_idx (page_id(317), namespace);
+