Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,12 @@ protected void downloadData(ProgressFeedback feedback, Boolean skip_orders, Stri
}
}


// After a download, table statistics might be worth re-evaluating for faster query
// execution. On SQLite, this will run PRAGMA optimize; which will be a no-op if there
// haven't been a lot of changes. On PostgreSQL, ANALYZE is a bit more expensive, so
// we'll see whether it is worth it.
// See recommendations on https://sqlite.org/lang_analyze.html
db.getCompatQueries().analyzeAfterSync();
} catch (DeviceAccessRevokedException e) {
db.getCompatQueries().truncateCheckIn();
db.getCompatQueries().truncateOrderPosition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ UPDATE QueuedOrder
SET
locked = TRUE
WHERE id = ?;

analyzeAfterSync:
ANALYZE SKIP_LOCKED;
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ UPDATE QueuedOrder
SET
locked = 1
WHERE id = ?;


analyzeAfterSync:
PRAGMA optimize;
Loading