kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add index to improve speed of MMS count.
rodzic
172751cd42
commit
130d5a8945
|
@ -191,7 +191,8 @@ public class MmsDatabase extends MessageDatabase {
|
||||||
"CREATE INDEX IF NOT EXISTS mms_thread_date_index ON " + TABLE_NAME + " (" + THREAD_ID + ", " + DATE_RECEIVED + ");",
|
"CREATE INDEX IF NOT EXISTS mms_thread_date_index ON " + TABLE_NAME + " (" + THREAD_ID + ", " + DATE_RECEIVED + ");",
|
||||||
"CREATE INDEX IF NOT EXISTS mms_reactions_unread_index ON " + TABLE_NAME + " (" + REACTIONS_UNREAD + ");",
|
"CREATE INDEX IF NOT EXISTS mms_reactions_unread_index ON " + TABLE_NAME + " (" + REACTIONS_UNREAD + ");",
|
||||||
"CREATE INDEX IF NOT EXISTS mms_is_story_index ON " + TABLE_NAME + " (" + STORY_TYPE + ");",
|
"CREATE INDEX IF NOT EXISTS mms_is_story_index ON " + TABLE_NAME + " (" + STORY_TYPE + ");",
|
||||||
"CREATE INDEX IF NOT EXISTS mms_parent_story_id_index ON " + TABLE_NAME + " (" + PARENT_STORY_ID + ");"
|
"CREATE INDEX IF NOT EXISTS mms_parent_story_id_index ON " + TABLE_NAME + " (" + PARENT_STORY_ID + ");",
|
||||||
|
"CREATE INDEX IF NOT EXISTS mms_thread_story_parent_story_index ON " + TABLE_NAME + " (" + THREAD_ID + ", " + DATE_RECEIVED + "," + STORY_TYPE + "," + PARENT_STORY_ID + ");",
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final String[] MMS_PROJECTION = new String[] {
|
private static final String[] MMS_PROJECTION = new String[] {
|
||||||
|
|
|
@ -194,6 +194,7 @@ object SignalDatabaseMigrations {
|
||||||
private const val STORIES = 132
|
private const val STORIES = 132
|
||||||
private const val ALLOW_STORY_REPLIES = 133
|
private const val ALLOW_STORY_REPLIES = 133
|
||||||
private const val GROUP_STORIES = 134
|
private const val GROUP_STORIES = 134
|
||||||
|
private const val MMS_COUNT_INDEX = 135
|
||||||
|
|
||||||
const val DATABASE_VERSION = 135
|
const val DATABASE_VERSION = 135
|
||||||
|
|
||||||
|
@ -2481,6 +2482,10 @@ object SignalDatabaseMigrations {
|
||||||
if (oldVersion < GROUP_STORIES) {
|
if (oldVersion < GROUP_STORIES) {
|
||||||
db.execSQL("ALTER TABLE groups ADD COLUMN display_as_story INTEGER DEFAULT 0")
|
db.execSQL("ALTER TABLE groups ADD COLUMN display_as_story INTEGER DEFAULT 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldVersion < MMS_COUNT_INDEX) {
|
||||||
|
db.execSQL("CREATE INDEX IF NOT EXISTS mms_thread_story_parent_story_index ON mms (thread_id, date_received, is_story, parent_story_id)")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
|
Ładowanie…
Reference in New Issue