🎨 Add index idx_attributes_block_id https://ld246.com/article/1742827508465

This commit is contained in:
Daniel 2025-03-25 00:12:51 +08:00
parent 44738e34c0
commit 37d358cd52
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -197,6 +197,10 @@ func initDBTables() {
if err != nil {
logging.LogFatalf(logging.ExitCodeReadOnlyDatabase, "create table [attributes] failed: %s", err)
}
_, err = db.Exec("CREATE INDEX idx_attributes_block_id ON attributes(block_id)")
if err != nil {
logging.LogFatalf(logging.ExitCodeReadOnlyDatabase, "create index [idx_attributes_block_id] failed: %s", err)
}
_, err = db.Exec("CREATE INDEX idx_attributes_root_id ON attributes(root_id)")
if err != nil {
logging.LogFatalf(logging.ExitCodeReadOnlyDatabase, "create index [idx_attributes_root_id] failed: %s", err)