]> err.no Git - mapper/commitdiff
Set some special sqlite pragmas to speed up import
authorKaj-Michael Lang <milang@tal.org>
Fri, 6 Jun 2008 11:16:21 +0000 (14:16 +0300)
committerKaj-Michael Lang <milang@tal.org>
Fri, 6 Jun 2008 11:16:21 +0000 (14:16 +0300)
src/osm-db-import.c

index cec035b655ed62954568461d6dee4c1b54f2efe8..45aa325839d31ec15dd90e0ce2fc6ac6526643aa 100644 (file)
@@ -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;