From 28120aa6aafde4f3b4e5cc26a9cd3e2376c1cd4b Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Fri, 6 Jun 2008 14:16:21 +0300 Subject: [PATCH] Set some special sqlite pragmas to speed up import --- src/osm-db-import.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osm-db-import.c b/src/osm-db-import.c index cec035b..45aa325 100644 --- a/src/osm-db-import.c +++ b/src/osm-db-import.c @@ -1754,6 +1754,12 @@ if (db_connect(&db, database)!=TRUE) { return FALSE; } +/* Set some sqlite PRAGMAs to speed up import */ +sqlite3_exec(db, "PRAGMA cache_size=16000;", NULL, NULL, NULL); +sqlite3_exec(db, "PRAGMA locking_mode=EXCLUSIVE;", NULL, NULL, NULL); +sqlite3_exec(db, "PRAGMA journal_mode=PERSIST;", NULL, NULL, NULL); +sqlite3_exec(db, "PRAGMA synchronous=OFF;", NULL, NULL, NULL); + if (!osm_db_create(db)) { g_printerr("Failed to create osm tables or indexes\n"); return FALSE; -- 2.39.5