From 03f351e21e47c7ff15b4e2f11dcb374fc902cddb Mon Sep 17 00:00:00 2001 From: Bang Kwang-Min Date: Mon, 18 Mar 2013 21:13:06 +0900 Subject: setting the property of sqlite3 : synchronous=OFF - do not ready to write to filesystem VACUUM - clear empty page Change-Id: I38c53c4b8043b66418eb90c36bacdd90aa085afd --- provider/download-provider-db.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/provider/download-provider-db.c b/provider/download-provider-db.c index 28a69b1..efdf919 100755 --- a/provider/download-provider-db.c +++ b/provider/download-provider-db.c @@ -47,8 +47,10 @@ sqlite3 *g_dp_db_handle = 0; // called when terminating process void dp_db_close() { - if (g_dp_db_handle) + if (g_dp_db_handle) { + sqlite3_exec(g_dp_db_handle, "VACUUM;", 0, 0, 0); // remove empty page of db db_util_close(g_dp_db_handle); + } g_dp_db_handle = 0; } @@ -65,6 +67,7 @@ int dp_db_open() } sqlite3_exec(g_dp_db_handle, "PRAGMA journal_mode=PERSIST;", 0, 0, 0); sqlite3_exec(g_dp_db_handle, "PRAGMA foreign_keys=ON;", 0, 0, 0); + sqlite3_exec(g_dp_db_handle, "PRAGMA synchronous=OFF;", 0, 0, 0); // do not ready to write to db } return g_dp_db_handle ? 0 : -1; } -- cgit v1.2.3