This process is what allows us to operate without the redundancy of a UTXO store, relying on just the block data and confirmation metadata. The two dominating costs of the confirmability checks are the spent_prevout(...) and unspendable_prevout(...) queries.