Improve blocktree storage performance

This commit is contained in:
Daniel 2024-07-14 22:25:13 +08:00
parent eb0879812f
commit 6fc0e43b77
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -85,6 +85,11 @@ func initDBTables() {
if nil != err {
logging.LogFatalf(logging.ExitCodeReadOnlyDatabase, "create table [blocktrees] failed: %s", err)
}
_, err = db.Exec("CREATE INDEX idx_blocktrees_id ON blocktrees(id)")
if nil != err {
logging.LogFatalf(logging.ExitCodeReadOnlyDatabase, "create index [idx_blocktrees_id] failed: %s", err)
}
}
func initDBConnection() {