性能优化

This commit is contained in:
heavyrain2012
2019-11-25 11:18:44 +08:00
parent 3afc6a2da9
commit c9089c5d51
3 changed files with 11 additions and 2 deletions
+1
View File
@@ -0,0 +1 @@
alter table t_friend_request add index `friend_request_uid_index` (`_friend_uid`);
+1
View File
@@ -0,0 +1 @@
alter table t_friend_request add index `friend_request_uid_index` (`_friend_uid`);
@@ -2223,7 +2223,14 @@ public class DatabaseStore {
", `_status`" + ", `_status`" +
", `_dt`" + ", `_dt`" +
", `_from_read_status`" + ", `_from_read_status`" +
", `_to_read_status` from t_friend_request where `_uid` = ? or `_friend_uid` = ?"; ", `_to_read_status` from t_friend_request where `_uid` = ? UNION ALL " +
"select `_uid`" +
", `_friend_uid`" +
", `_reason`" +
", `_status`" +
", `_dt`" +
", `_from_read_status`" +
", `_to_read_status` from t_friend_request where `_friend_uid` = ?";
statement = connection.prepareStatement(sql); statement = connection.prepareStatement(sql);
int index = 1; int index = 1;