mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-26 07:37:08 +00:00
Fix possible performance issues with reactions query.
This commit is contained in:
@@ -97,8 +97,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
private static final int USERNAMES = 36;
|
||||
private static final int REACTIONS = 37;
|
||||
private static final int STORAGE_SERVICE = 38;
|
||||
private static final int REACTIONS_UNREAD_INDEX = 39;
|
||||
|
||||
private static final int DATABASE_VERSION = 38;
|
||||
private static final int DATABASE_VERSION = 39;
|
||||
private static final String DATABASE_NAME = "signal.db";
|
||||
|
||||
private final Context context;
|
||||
@@ -673,6 +674,11 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
// }
|
||||
}
|
||||
|
||||
if (oldVersion < REACTIONS_UNREAD_INDEX) {
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS sms_reactions_unread_index ON sms (reactions_unread);");
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS mms_reactions_unread_index ON mms (reactions_unread);");
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
|
||||
Reference in New Issue
Block a user