duality-labs / hapi-indexer

A Node.js based indexer for the Duality Cosmos chain
1 stars 0 forks source link

feat: add SQLite WAL mode for faster writes #35

Closed dib542 closed 10 months ago

dib542 commented 10 months ago

In SQLite3 WAL mode isn't enabled by default, it is turned on by the specific statement:

PRAGMA journal_mode=WAL;

https://www.sqlite.org/wal.html

In some quick tests this reduced the time to import files by about half when writing to a file. It did not seem to affect import times when in SQLite was in memory-only mode (env var DB_FILENAME=:memory:).