Index: credentials.sql
===================================================================
--- credentials.sql	(revision 378)
+++ credentials.sql	(revision 379)
@@ -14,7 +14,7 @@
 	confirm varchar(32),
 	data text
 );
-create index profile_credentials_user_class_name on profile_credentials (class, uid, name);
-create index profile_credentials_user_class_ext_id on profile_credentials (class, uid, ext_id);
+create index profile_credentials_user_class_ext_id on profile_credentials (class, uid, ext_id) where ext_id != 0;
+create index profile_credentials_user_class_name on profile_credentials (class, uid, name) where ext_id = 0;
 create unique index profile_credentials_class_ext_id on profile_credentials (class, ext_id) where ext_id != 0;
 create unique index profile_credentials_class_name on profile_credentials (class, name) where ext_id = 0;
