mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
db: Add index covering the output heights
Avoids performing a table scan, now deletes on blocks are a lot faster. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
c9985805cd
commit
247aa13a58
1 changed files with 2 additions and 0 deletions
|
@ -215,6 +215,8 @@ char *dbmigrations[] = {
|
|||
* die. */
|
||||
"ALTER TABLE outputs ADD COLUMN confirmation_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;",
|
||||
"ALTER TABLE outputs ADD COLUMN spend_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;",
|
||||
/* Create a covering index that covers both fields */
|
||||
"CREATE INDEX output_height_idx ON outputs (confirmation_height, spend_height);",
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue