From aaeb5ec6a16a64e11888f585f0571d6207226fbd Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Thu, 15 Jan 2009 22:44:49 +0100 Subject: [PATCH] Add missing indexes on uid. Signed-off-by: Florent Bruneau --- upgrade/newdirectory-0.0.1/02_networking.sql | 4 +++- upgrade/newdirectory-0.0.1/04_telephone.sql | 4 +++- upgrade/newdirectory-0.0.1/06_education.sql | 3 ++- upgrade/newdirectory-0.0.1/11_jobs.sql | 3 ++- upgrade/newdirectory-0.0.1/13_mentoring.sql | 6 ++++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/upgrade/newdirectory-0.0.1/02_networking.sql b/upgrade/newdirectory-0.0.1/02_networking.sql index 17172c9..8b3e0d6 100644 --- a/upgrade/newdirectory-0.0.1/02_networking.sql +++ b/upgrade/newdirectory-0.0.1/02_networking.sql @@ -13,7 +13,8 @@ CREATE TABLE IF NOT EXISTS `profile_networking` ( `network_type` tinyint unsigned NOT NULL, `address` varchar(255) NOT NULL, `pub` enum('private','public') NOT NULL DEFAULT 'private', - PRIMARY KEY (`uid`, `nwid`) + PRIMARY KEY (`uid`, `nwid`), + INDEX uid (uid) ) CHARSET=utf8 COMMENT='networking addresses'; -- Insert a first address type for old URLs @@ -42,3 +43,4 @@ ALTER TABLE `watch_profile` ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web`; ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web_pub`; +# vim:set syntax=mysql: diff --git a/upgrade/newdirectory-0.0.1/04_telephone.sql b/upgrade/newdirectory-0.0.1/04_telephone.sql index f415a79..bff48ee 100644 --- a/upgrade/newdirectory-0.0.1/04_telephone.sql +++ b/upgrade/newdirectory-0.0.1/04_telephone.sql @@ -9,7 +9,8 @@ CREATE TABLE IF NOT EXISTS `profile_phones` ( `pub` enum('private', 'ax', 'public') NOT NULL DEFAULT 'private', `comment` varchar(80) NOT NULL, PRIMARY KEY(`uid`, `link_type`, `link_id`, `tel_id`), - INDEX (`search_tel`) + INDEX (`search_tel`), + INDEX uid (uid) ); @@ -19,3 +20,4 @@ ALTER TABLE `geoloc_pays` ADD COLUMN `tmp_phoneprf` smallint unsigned NULL; -- Adds phone format column ALTER TABLE `geoloc_pays` ADD COLUMN `phoneformat` varchar(25) NOT NULL AFTER `nat`; +# vim:set syntax=mysql: diff --git a/upgrade/newdirectory-0.0.1/06_education.sql b/upgrade/newdirectory-0.0.1/06_education.sql index 865d888..708e8ef 100644 --- a/upgrade/newdirectory-0.0.1/06_education.sql +++ b/upgrade/newdirectory-0.0.1/06_education.sql @@ -40,7 +40,8 @@ CREATE TABLE IF NOT EXISTS profile_education ( grad_year INT(4) DEFAULT NULL, program VARCHAR(255) DEFAULT NULL, flags SET('primary') DEFAULT '' NOT NULL, - PRIMARY KEY(id, uid) + PRIMARY KEY(id, uid), + INDEX uid (uid) ) CHARSET=utf8; INSERT INTO profile_education_field_enum (field) diff --git a/upgrade/newdirectory-0.0.1/11_jobs.sql b/upgrade/newdirectory-0.0.1/11_jobs.sql index c096a42..51de47f 100644 --- a/upgrade/newdirectory-0.0.1/11_jobs.sql +++ b/upgrade/newdirectory-0.0.1/11_jobs.sql @@ -28,7 +28,8 @@ CREATE TABLE IF NOT EXISTS profile_job ( email VARCHAR(255) NOT NULL DEFAULT '', pub ENUM('private', 'ax', 'public') DEFAULT 'private', email_pub ENUM('private', 'ax', 'public') DEFAULT 'private', - PRIMARY KEY (uid, id) + PRIMARY KEY (uid, id), + INDEX uid (uid) ) CHARSET=utf8; INSERT IGNORE INTO profile_job_enum (name, url) diff --git a/upgrade/newdirectory-0.0.1/13_mentoring.sql b/upgrade/newdirectory-0.0.1/13_mentoring.sql index dbd8127..90987c1 100644 --- a/upgrade/newdirectory-0.0.1/13_mentoring.sql +++ b/upgrade/newdirectory-0.0.1/13_mentoring.sql @@ -16,7 +16,8 @@ INSERT INTO profile_mentor (uid, expertise) CREATE TABLE IF NOT EXISTS profile_mentor_country ( uid INT(11) NOT NULL DEFAULT 0, country CHAR(2) NOT NULL DEFAULT "FR", - PRIMARY KEY (uid, country) + PRIMARY KEY (uid, country), + INDEX uid (uid) ) CHARSET=utf8; INSERT INTO profile_mentor_country (uid, country) @@ -27,7 +28,8 @@ CREATE TABLE IF NOT EXISTS profile_mentor_sector ( uid INT(11) NOT NULL DEFAULT 0, sectorid TINYINT(2) UNSIGNED NOT NULL, subsectorid TINYINT(3) UNSIGNED NOT NULL, - PRIMARY KEY (uid, sectorid, subsectorid) + PRIMARY KEY (uid, sectorid, subsectorid), + INDEX uid (uid) ) CHARSET=utf8; -- vim:set syntax=mysql: -- 2.1.4