increase default pagesize to 4096 on sqlite

This commit is contained in:
David Hill 2013-10-03 10:32:19 -04:00
parent 63f8993163
commit 9abf071308

View file

@ -210,6 +210,10 @@ func newOrCreateSqliteDB(filepath string, create bool) (pbdb btcdb.Db, err error
return nil, err
}
db.Exec("PRAGMA page_size=4096;")
db.Exec("PRAGMA foreign_keys=ON;")
db.Exec("PRAGMA journal_mode=WAL;")
dbverstmt, err := db.Prepare("SELECT version FROM dbversion;")
if err != nil {
// about the only reason this would fail is that the database
@ -242,8 +246,6 @@ func newOrCreateSqliteDB(filepath string, create bool) (pbdb btcdb.Db, err error
log.Warnf("mismatch db version: %v expected %v\n", version, dbVersion)
return nil, fmt.Errorf("Invalid version in database")
}
db.Exec("PRAGMA foreign_keys = ON;")
db.Exec("PRAGMA journal_mode=WAL;")
bdb.sqldb = db
bdb.blkStmts = make([]*sql.Stmt, len(blkqueries))