Add indexes to temp tables when updating.
The idnexes which are added are for those columns which are used to calculate information such as latest upstream version. These queries use subqueries which seemed to be adversely impacted by the lack of indexes. In total, reduced update time on test device from just over 100 seconds to just over 60 seconds.
This commit is contained in:
parent
c24cd89028
commit
1ae1ae7368
@ -123,6 +123,9 @@ public class TempApkProvider extends ApkProvider {
|
||||
private void initTable() {
|
||||
write().execSQL("DROP TABLE IF EXISTS " + getTableName());
|
||||
write().execSQL("CREATE TABLE " + getTableName() + " AS SELECT * FROM " + DBHelper.TABLE_APK);
|
||||
write().execSQL("CREATE INDEX IF NOT EXISTS apk_vercode on " + getTableName() + " (vercode);");
|
||||
write().execSQL("CREATE INDEX IF NOT EXISTS apk_id on " + getTableName() + " (id);");
|
||||
write().execSQL("CREATE INDEX IF NOT EXISTS apk_compatible ON " + getTableName() + " (compatible);");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -114,6 +114,9 @@ public class TempAppProvider extends AppProvider {
|
||||
private void initTable() {
|
||||
write().execSQL("DROP TABLE IF EXISTS " + getTableName());
|
||||
write().execSQL("CREATE TABLE " + getTableName() + " AS SELECT * FROM " + DBHelper.TABLE_APP);
|
||||
write().execSQL("CREATE INDEX IF NOT EXISTS app_id ON " + getTableName() + " (id);");
|
||||
write().execSQL("CREATE INDEX IF NOT EXISTS app_upstreamVercode ON " + getTableName() + " (upstreamVercode);");
|
||||
write().execSQL("CREATE INDEX IF NOT EXISTS app_compatible ON " + getTableName() + " (compatible);");
|
||||
}
|
||||
|
||||
private void commitTable() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user