Closed kantai closed 3 weeks ago
Do we need a new schema version?
I didn't think so -- doesn't the index creation code just always run and check if indexes need to be created?
Ah, yes, you're right -- specifically for the chainstate (we really should do something about that too -- I bet those transactions are really unecessary)
oops, I missed the Self::need_schema_migrations()
call
Ah, yes, you're right -- specifically for the chainstate (we really should do something about that too -- I bet those transactions are really unecessary)
Nope, I was wrong!
if create_flag {
// instantiate!
StacksChainState::instantiate_db(mainnet, chain_id, index_path, true)
} else {
let mut marf = StacksChainState::open_index(index_path)?;
if !Self::need_schema_migrations(marf.sqlite_conn(), mainnet, chain_id)? {
return Ok(marf);
}
// need a migration
let tx = marf.storage_tx()?;
StacksChainState::apply_schema_migrations(&tx, mainnet, chain_id)?;
StacksChainState::add_indexes(&tx)?;
tx.commit()?;
Will add a schema version.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
Optimization: add index for
index_block_hash
innakamoto_block_headers