Index: openacs-4/packages/forums/sql/postgresql/forums-messages-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/forums-messages-create.sql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/forums/sql/postgresql/forums-messages-create.sql	30 Nov 2002 17:35:03 -0000	1.6
+++ openacs-4/packages/forums/sql/postgresql/forums-messages-create.sql	16 Jan 2003 13:49:10 -0000	1.7
@@ -55,6 +55,10 @@
     unique (tree_sortkey, forum_id)
 );
 
+-- We do a some big queries on forum_id (thread count on index.tcl) so create a second index 
+-- ordered so it's useful for them
+create unique index forums_mess_forum_sk_un on forums_messages(forum_id, tree_sortkey);
+
 create view forums_messages_approved
 as
     select *
