summaryrefslogtreecommitdiff
path: root/platform/default/src/mbgl/storage/offline_database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/default/src/mbgl/storage/offline_database.cpp')
-rw-r--r--platform/default/src/mbgl/storage/offline_database.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/default/src/mbgl/storage/offline_database.cpp b/platform/default/src/mbgl/storage/offline_database.cpp
index 133e1f7992..e27ccbf313 100644
--- a/platform/default/src/mbgl/storage/offline_database.cpp
+++ b/platform/default/src/mbgl/storage/offline_database.cpp
@@ -145,6 +145,8 @@ void OfflineDatabase::removeOldCacheTable() {
void OfflineDatabase::createSchema() {
assert(db);
+ db->exec("PRAGMA auto_vacuum = INCREMENTAL");
+ db->exec("VACUUM");
db->exec("PRAGMA journal_mode = DELETE");
db->exec("PRAGMA synchronous = FULL");
mapbox::sqlite::Transaction transaction(*db);
@@ -155,6 +157,7 @@ void OfflineDatabase::createSchema() {
void OfflineDatabase::migrateToVersion3() {
assert(db);
+ db->exec("PRAGMA auto_vacuum = INCREMENTAL");
db->exec("VACUUM");
db->exec("PRAGMA user_version = 3");
}
@@ -683,7 +686,7 @@ std::exception_ptr OfflineDatabase::clearAmbientCache() try {
resourceQuery.run();
- db->exec("VACUUM");
+ db->exec("PRAGMA incremental_vacuum");
return nullptr;
} catch (const mapbox::sqlite::Exception& ex) {
@@ -871,7 +874,7 @@ std::exception_ptr OfflineDatabase::deleteRegion(OfflineRegion&& region) try {
evict(0);
assert(db);
- db->exec("VACUUM");
+ db->exec("PRAGMA incremental_vacuum");
// Ensure that the cached offlineTileCount value is recalculated.
offlineMapboxTileCount = {};