Revert "increase sqlite cache size (#2607)"

This reverts commit f55c4bc40238be7fa6f0ad658bef38e8489a6d97.
This commit is contained in:
Jacek Sieka 2021-05-28 11:35:23 +02:00
parent f55c4bc402
commit 5be1f8bf93
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8

View File

@ -19,10 +19,6 @@ import
logScope: topics = "bc_db"
const
# Negative cache size to make sqlite use kilobytes
cacheSize = -24 * 1024 # 24mb
type
DbSeq*[T] = object
insertStmt: SqliteStmt[openArray[byte], void]
@ -276,11 +272,8 @@ proc new*(T: type BeaconChainDB,
# Remove the deposits table we used before we switched
# to storing only deposit contract checkpoints
if (let e = db.exec("DROP TABLE IF EXISTS deposits;"); e.isErr):
warn "Failed to drop the deposits table", msg = e.error()
if (let e = db.exec("PRAGMA cache_size=" & $cacheSize & ";"); e.isErr):
warn "Failed to set cache size", msg = e.error()
if db.exec("DROP TABLE IF EXISTS deposits;").isErr:
debug "Failed to drop the deposits table"
# An old pubkey->index mapping that hasn't been used on any mainnet release
if db.exec("DROP TABLE IF EXISTS validatorIndexFromPubKey;").isErr: