From 6d54f3c82679a54d3666880088597cb8278aaaac Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Thu, 12 Oct 2006 01:42:15 +0000 Subject: [PATCH] Add database/quick_startup directive to specify that the database should start up quickly -- without vacuum in the case of sqlite --- src/db-sql-sqlite2.c | 4 +++- src/db-sql-sqlite3.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/db-sql-sqlite2.c b/src/db-sql-sqlite2.c index 960c1133..04365157 100644 --- a/src/db-sql-sqlite2.c +++ b/src/db-sql-sqlite2.c @@ -321,7 +321,9 @@ int db_sqlite2_event(int event_type) { switch(event_type) { case DB_SQL_EVENT_STARTUP: /* this is a startup with existing songs */ - db_sqlite2_exec(NULL,E_FATAL,"vacuum"); + if(!conf_get_int("database","quick_startup",0)) + db_sqlite2_exec(NULL,E_FATAL,"vacuum"); + /* make sure our indexes exist */ db_sqlite2_exec(NULL,E_DBG,"create index idx_path on " "songs(path,idx)"); diff --git a/src/db-sql-sqlite3.c b/src/db-sql-sqlite3.c index 67c9a83a..3903b4df 100644 --- a/src/db-sql-sqlite3.c +++ b/src/db-sql-sqlite3.c @@ -356,7 +356,9 @@ int db_sqlite3_event(int event_type) { switch(event_type) { case DB_SQL_EVENT_STARTUP: /* this is a startup with existing songs */ - db_sqlite3_exec(NULL,E_FATAL,"vacuum"); + if(!conf_get_int("database","quick_startup",0)) + db_sqlite3_exec(NULL,E_FATAL,"vacuum"); + db_sqlite3_exec(NULL,E_DBG,"create index idx_path on " "songs(path,idx)"); db_sqlite3_exec(NULL,E_DBG,"create index idx_songid on "