mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
db: Add index on utxoset.spendheight to speed up blockchain reorgs
Otherwise we would be doing a table scan per block being reorged/rescanned. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
e44ea0b363
commit
50a8e32e3f
@ -227,6 +227,9 @@ char *dbmigrations[] = {
|
||||
" satoshis BIGINT,"
|
||||
" PRIMARY KEY(txid, outnum));",
|
||||
"CREATE INDEX short_channel_id ON utxoset (blockheight, txindex, outnum)",
|
||||
/* Necessary index for long rollbacks of the blockchain, otherwise we're
|
||||
* doing table scans for every block removed. */
|
||||
"CREATE INDEX utxoset_spend ON utxoset (spendheight)",
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user