Skip to content

Commit

Permalink
[client-sync] Increase sqlite page_size and cache_size
Browse files Browse the repository at this point in the history
Summary:
The defaults are a little low. edgehill.db already does this. There's no
obvious effect on smaller dbs, but we should at least make the two
consistent.

Test Plan: Run locally

Reviewers: spang, evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4395
  • Loading branch information
Mark Hahnenberg committed Apr 7, 2017
1 parent 3befaf2 commit b323e38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client-sync/src/shared/local-database-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ class LocalDatabaseConnector {
const dbLog = (q, time) => {
debugVerbose(StringUtils.trimTo(`🔷 (${time}ms) ${q}`))
}
return new Sequelize(dbname, '', '', {
const sequelize = new Sequelize(dbname, '', '', {
storage: storage,
dialect: "sqlite",
benchmark: debugVerbose.enabled,
logging: debugVerbose.enabled ? dbLog : false,
})
sequelize.query('PRAGMA page_size = 8192');
sequelize.query('PRAGMA cache_size = 4096');
return sequelize;
}

forAccount(accountId) {
Expand Down

0 comments on commit b323e38

Please sign in to comment.