Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- db_bench_sqlite3.cc.orig 2011-07-28 23:46:04.000000000 +0400
- +++ db_bench_sqlite3.cc.5x 2011-07-29 04:23:52.000000000 +0400
- @@ -74,7 +74,7 @@
- static bool FLAGS_transaction = true;
- // If true, we enable Write-Ahead Logging
- -static bool FLAGS_WAL_enabled = false;
- +static bool FLAGS_WAL_enabled = true;
- inline
- static void ExecErrorCheck(int status, char *err_msg) {
- @@ -454,10 +454,10 @@
- // Change locking mode to exclusive and create tables/index for database
- std::string locking_stmt = "PRAGMA locking_mode = EXCLUSIVE";
- + std::string wal_stmt = "PRAGMA wal_autocheckpoint = 4096";
- std::string create_stmt =
- "CREATE TABLE test (key blob, value blob, PRIMARY KEY(key))";
- - std::string index_stmt = "CREATE INDEX keyindex ON test (key)";
- - std::string stmt_array[] = { locking_stmt, create_stmt, index_stmt };
- + std::string stmt_array[] = { locking_stmt, wal_stmt, create_stmt };
- int stmt_array_length = sizeof(stmt_array) / sizeof(std::string);
- for (int i = 0; i < stmt_array_length; i++) {
- status = sqlite3_exec(db_, stmt_array[i].c_str(), NULL, NULL, &err_msg);
- @@ -494,7 +494,7 @@
- std::string end_trans_str = "END TRANSACTION;";
- // Check for synchronous flag in options
- - std::string sync_stmt = (write_sync) ? "PRAGMA synchronous = FULL" :
- + std::string sync_stmt = (write_sync) ? "PRAGMA synchronous = NORMAL" :
- "PRAGMA synchronous = OFF";
- status = sqlite3_exec(db_, sync_stmt.c_str(), NULL, NULL, &err_msg);
- ExecErrorCheck(status, err_msg);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement