Skip to content

Commit 0961a98

Browse files
committed
db, refactor: performance tuning for SQLite.
1 parent f38fe11 commit 0961a98

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fibjs/src/db/sql/SQLite.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ result_t SQLite::open(const char* file)
5353

5454
obj_ptr<NArray> retVal;
5555
cc_execute("PRAGMA journal_mode=WAL;", retVal);
56+
cc_execute("PRAGMA synchronous=normal;", retVal);
57+
cc_execute("PRAGMA temp_store=memory;", retVal);
5658

5759
m_file = file;
5860

test/db_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ describe("db", () => {
13461346
var synchronous = conn.execute("PRAGMA synchronous;")[0].synchronous;
13471347
conn.close();
13481348

1349-
assert.equal(synchronous, 2);
1349+
assert.equal(synchronous, 1);
13501350
});
13511351

13521352
it("check journal mode", () => {

0 commit comments

Comments
 (0)