From 9a428acad03aac3d9954bed0e94cc1559fb8998d Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Fri, 6 Sep 2024 12:00:31 -0700 Subject: [PATCH] sqlite: add index on block_id and transaction_id --- persist/sqlite/init.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persist/sqlite/init.sql b/persist/sqlite/init.sql index 728457ec..28810c9e 100644 --- a/persist/sqlite/init.sql +++ b/persist/sqlite/init.sql @@ -133,7 +133,6 @@ CREATE TABLE transactions ( id INTEGER PRIMARY KEY, transaction_id BLOB UNIQUE NOT NULL ); - CREATE INDEX transactions_transaction_id_index ON transactions(transaction_id); CREATE TABLE block_transactions ( @@ -144,6 +143,7 @@ CREATE TABLE block_transactions ( ); CREATE INDEX block_transactions_block_id_index ON block_transactions(block_id); CREATE INDEX block_transactions_transaction_id_index ON block_transactions(transaction_id); +CREATE INDEX block_transactions_transaction_id_block_id ON block_transactions(transaction_id, block_id); CREATE TABLE transaction_arbitrary_data ( transaction_id INTEGER REFERENCES transactions(id) ON DELETE CASCADE NOT NULL,