[Svn] r2999 - trunk/roundcubemail/SQL

trac at roundcube.net trac at roundcube.net
Tue Sep 29 09:59:26 CEST 2009


Author: alec
Date: 2009-09-29 02:59:25 -0500 (Tue, 29 Sep 2009)
New Revision: 2999

Modified:
   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:
- use better index for contacts table


Modified: trunk/roundcubemail/SQL/mysql.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/mysql.initial.sql	2009-09-29 06:32:57 UTC (rev 2998)
+++ trunk/roundcubemail/SQL/mysql.initial.sql	2009-09-29 07:59:25 UTC (rev 2999)
@@ -95,6 +95,7 @@
  `vcard` text NULL,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`contact_id`),
+ INDEX `user_contacts_index` (`user_id`,`email`),
  CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
    /*!40008

Modified: trunk/roundcubemail/SQL/mysql.update.sql
===================================================================
--- trunk/roundcubemail/SQL/mysql.update.sql	2009-09-29 06:32:57 UTC (rev 2998)
+++ trunk/roundcubemail/SQL/mysql.update.sql	2009-09-29 07:59:25 UTC (rev 2999)
@@ -54,3 +54,6 @@
 
 ALTER TABLE `session` 
     CHANGE `vars` `vars` MEDIUMTEXT NOT NULL;
+
+ALTER TABLE `contacts`
+    ADD INDEX `user_contacts_index` (`user_id`,`email`);

Modified: trunk/roundcubemail/SQL/postgres.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/postgres.initial.sql	2009-09-29 06:32:57 UTC (rev 2998)
+++ trunk/roundcubemail/SQL/postgres.initial.sql	2009-09-29 07:59:25 UTC (rev 2999)
@@ -110,7 +110,7 @@
     vcard text
 );
 
-CREATE INDEX contacts_user_id_idx ON contacts (user_id);
+CREATE INDEX contacts_user_id_idx ON contacts (user_id, email);
 
 --
 -- Sequence "cache_ids"

Modified: trunk/roundcubemail/SQL/postgres.update.sql
===================================================================
--- trunk/roundcubemail/SQL/postgres.update.sql	2009-09-29 06:32:57 UTC (rev 2998)
+++ trunk/roundcubemail/SQL/postgres.update.sql	2009-09-29 07:59:25 UTC (rev 2999)
@@ -41,3 +41,5 @@
 
 CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
 TRUNCATE messages;
+DROP INDEX contacts_user_id_idx;
+CREATE INDEX contacts_user_id_idx ON contacts (user_id, email);

Modified: trunk/roundcubemail/SQL/sqlite.initial.sql
===================================================================
--- trunk/roundcubemail/SQL/sqlite.initial.sql	2009-09-29 06:32:57 UTC (rev 2998)
+++ trunk/roundcubemail/SQL/sqlite.initial.sql	2009-09-29 07:59:25 UTC (rev 2999)
@@ -34,7 +34,7 @@
   vcard text NOT NULL default ''
 );
 
-CREATE INDEX ix_contacts_user_id ON contacts(user_id);
+CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
 
 -- --------------------------------------------------------
 

Modified: trunk/roundcubemail/SQL/sqlite.update.sql
===================================================================
--- trunk/roundcubemail/SQL/sqlite.update.sql	2009-09-29 06:32:57 UTC (rev 2998)
+++ trunk/roundcubemail/SQL/sqlite.update.sql	2009-09-29 07:59:25 UTC (rev 2999)
@@ -41,3 +41,5 @@
 CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
 CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
 TRUNCATE messages;
+DROP INDEX ix_contacts_user_id;
+CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);

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



More information about the Svn mailing list