From 63c51a6ed448fdc1c4d3656ebc8cce1d1e2e1d13 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 13 Sep 2022 00:07:49 +0000 Subject: [PATCH] Add some further indexes on channel_updates to match queries --- src/config.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.rs b/src/config.rs index cd7a09d..5369e8d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -85,6 +85,8 @@ pub(crate) fn db_index_creation_query() -> &'static str { CREATE INDEX IF NOT EXISTS channel_updates_scid ON channel_updates(short_channel_id); CREATE INDEX IF NOT EXISTS channel_updates_direction ON channel_updates (short_channel_id, direction); CREATE INDEX IF NOT EXISTS channel_updates_seen ON channel_updates(seen); + CREATE INDEX IF NOT EXISTS channel_updates_scid_seen ON channel_updates(short_channel_id, seen); + CREATE INDEX IF NOT EXISTS channel_updates_scid_dir_seen ON channel_updates(short_channel_id ASC, direction ASC, seen DESC); " } -- 2.39.5