[Svn] r4567 - in trunk/roundcubemail: . SQL

trac at roundcube.net trac at roundcube.net
Wed Feb 23 09:13:02 CET 2011


Author: alec
Date: 2011-02-23 02:13:02 -0600 (Wed, 23 Feb 2011)
New Revision: 4567

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/SQL/mssql.initial.sql
   trunk/roundcubemail/SQL/mssql.upgrade.sql
   trunk/roundcubemail/SQL/mysql.initial.sql
   trunk/roundcubemail/SQL/mysql.update.sql
   trunk/roundcubemail/SQL/postgres.initial.sql
   trunk/roundcubemail/SQL/postgres.update.sql
   trunk/roundcubemail/SQL/sqlite.initial.sql
   trunk/roundcubemail/SQL/sqlite.update.sql
Log:
- Add index on contactgroupmembers.contact_id column.
  Improves performance and fixes problem with contactgroupmembers table creation on MySQL 4.x


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/CHANGELOG	2011-02-23 08:13:02 UTC (rev 4567)
@@ -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)

Modified: trunk/roundcubemail/SQL/mssql.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/mssql.initial.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/mssql.initial.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -195,6 +195,8 @@
 	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],

Modified: trunk/roundcubemail/SQL/mssql.upgrade.sql
===================================================================
--- trunk/roundcubemail/SQL/mssql.upgrade.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/mssql.upgrade.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -101,3 +101,5 @@
 
 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

Modified: trunk/roundcubemail/SQL/mysql.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/mysql.initial.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/mysql.initial.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -117,7 +117,8 @@
   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 */;
 
 

Modified: trunk/roundcubemail/SQL/mysql.update.sql
===================================================================
--- trunk/roundcubemail/SQL/mysql.update.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/mysql.update.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -136,3 +136,5 @@
 -- Updates from version 0.5.*
 
 ALTER TABLE `contacts` ADD `words` TEXT NULL AFTER `vcard`;
+ALTER TABLE `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index` (`contact_id`);
+ 
\ No newline at end of file

Modified: trunk/roundcubemail/SQL/postgres.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/postgres.initial.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/postgres.initial.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -157,6 +157,8 @@
     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

Modified: trunk/roundcubemail/SQL/postgres.update.sql
===================================================================
--- trunk/roundcubemail/SQL/postgres.update.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/postgres.update.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -90,8 +90,7 @@
 
 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);

Modified: trunk/roundcubemail/SQL/sqlite.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/sqlite.initial.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/sqlite.initial.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -56,7 +56,9 @@
   PRIMARY KEY (contactgroup_id, contact_id)
 );
 
+CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
 
+
 -- --------------------------------------------------------
 
 -- 

Modified: trunk/roundcubemail/SQL/sqlite.update.sql
===================================================================
--- trunk/roundcubemail/SQL/sqlite.update.sql	2011-02-20 12:42:01 UTC (rev 4566)
+++ trunk/roundcubemail/SQL/sqlite.update.sql	2011-02-23 08:13:02 UTC (rev 4567)
@@ -221,3 +221,4 @@
 DROP TABLE contacts_tmp;
 
 DELETE FROM messages;
+CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list