Changeset 218
- Timestamp:
- 02/07/07 21:59:32 (1 year ago)
- Files:
-
- 06/libkombilo/search.cpp (modified) (4 diffs)
- 06/libkombilo/search.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
06/libkombilo/search.cpp
r217 r218 3378 3378 } 3379 3379 3380 GameList::GameList(char* DBNAME, string ORDERBY, string FORMAT, ProcessOptions* p_options ) throw(DBError) {3380 GameList::GameList(char* DBNAME, string ORDERBY, string FORMAT, ProcessOptions* p_options, int cache) throw(DBError) { 3381 3381 labels = 0; 3382 3382 continuations = 0; … … 3397 3397 rc = sqlite3_exec(algo_db1, "pragma synchronous = off;", 0, 0, 0); 3398 3398 if (rc) throw DBError(); 3399 rc = sqlite3_exec(algo_db1, "pragma cache_size = 100000;", 0, 0, 0); 3399 char cache_str[100]; 3400 sprintf(cache_str, "pragma cache_size = %d", cache*1000); 3401 rc = sqlite3_exec(algo_db1, cache_str, 0, 0, 0); 3400 3402 if (rc) throw DBError(); 3401 3403 dbname[strlen(DBNAME)] = '2'; … … 3411 3413 rc = sqlite3_exec(algo_db2, "pragma synchronous = off;", 0, 0, 0); 3412 3414 if (rc) throw DBError(); 3413 rc = sqlite3_exec(algo_db2, "pragma cache_size = 700000;", 0, 0, 0); 3415 sprintf(cache_str, "pragma cache_size = %d", cache*7000); 3416 rc = sqlite3_exec(algo_db1, cache_str, 0, 0, 0); 3414 3417 if (rc) throw DBError(); 3415 3418 … … 3426 3429 rc = sqlite3_exec(db, "pragma synchronous = off;", 0, 0, 0); 3427 3430 if (rc) throw DBError(); 3428 rc = sqlite3_exec(db, "pragma cache_size = 100000;", 0, 0, 0); 3431 sprintf(cache_str, "pragma cache_size = %d", cache*1000); 3432 rc = sqlite3_exec(algo_db1, cache_str, 0, 0, 0); 3429 3433 if (rc) throw DBError(); 3430 3434 06/libkombilo/search.h
r217 r218 590 590 // ------- constructor -------------------------------------------------------- 591 591 // p_options will be copied by GameList, so the caller has to free the pointer 592 GameList(char* DBNAME, std::string ORDERBY="", std::string FORMAT="", ProcessOptions* p_options=0 ) throw(DBError);592 GameList(char* DBNAME, std::string ORDERBY="", std::string FORMAT="", ProcessOptions* p_options=0, int cache=100) throw(DBError); 593 593 594 594 // ------- processing SGF games (to populate the db) --------------------------
