Permalink
Browse files

- Add index on contactgroupmembers.contact_id column.

  Improves performance and fixes problem with contactgroupmembers table creation on MySQL 4.x
  • Loading branch information...
1 parent 5744bfa commit 3a5476d150419b46847dd922935f368c969519c1 @alecpl alecpl committed Feb 23, 2011
View
1 CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix problem with contactgroupmembers table creation on MySQL 4.x, add index on contact_id column
- Add LDAP SASL bind and proxy authentication (#1486692)
- Add variable for 'Today' label in date_today option (#1486120)
- Fix dont_override setting does not override existing user preferences (#1487664)
View
2 SQL/mssql.initial.sql
@@ -195,6 +195,8 @@ ALTER TABLE [dbo].[contactgroupmembers] ADD
CONSTRAINT [DF_contactgroupmembers_created] DEFAULT (getdate()) FOR [created]
GO
+CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY]
+GO
ALTER TABLE [dbo].[identities] ADD
CONSTRAINT [DF_identities_user] DEFAULT ('0') FOR [user_id],
View
2 SQL/mssql.upgrade.sql
@@ -101,3 +101,5 @@ GO
ALTER TABLE [dbo].[contacts] ADD [words] [text] COLLATE Latin1_General_CI_AI NULL
GO
+CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY]
+GO
View
3 SQL/mysql.initial.sql
@@ -117,7 +117,8 @@ CREATE TABLE `contactgroupmembers` (
CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`)
REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`)
- REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE
+ REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ INDEX `contactgroupmembers_contact_index` (`contact_id`)
) /*!40000 ENGINE=INNODB */;
View
2 SQL/mysql.update.sql
@@ -136,3 +136,5 @@ TRUNCATE TABLE `messages`;
-- Updates from version 0.5.*
ALTER TABLE `contacts` ADD `words` TEXT NULL AFTER `vcard`;
+ALTER TABLE `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index` (`contact_id`);
+
View
2 SQL/postgres.initial.sql
@@ -157,6 +157,8 @@ CREATE TABLE contactgroupmembers (
PRIMARY KEY (contactgroup_id, contact_id)
);
+CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id);
+
--
-- Sequence "cache_ids"
-- Name: cache_ids; Type: SEQUENCE; Schema: public; Owner: postgres
View
3 SQL/postgres.update.sql
@@ -90,8 +90,7 @@ ALTER TABLE contacts ALTER email TYPE varchar(255);
TRUNCATE messages;
-
-- Updates from version 0.5.x
ALTER TABLE contacts ADD words TEXT NULL;
-
+CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id);
View
2 SQL/sqlite.initial.sql
@@ -56,6 +56,8 @@ CREATE TABLE contactgroupmembers (
PRIMARY KEY (contactgroup_id, contact_id)
);
+CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
+
-- --------------------------------------------------------
View
1 SQL/sqlite.update.sql
@@ -221,3 +221,4 @@ CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
DROP TABLE contacts_tmp;
DELETE FROM messages;
+CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);

0 comments on commit 3a5476d

Please sign in to comment.