From: Matt Corallo Date: Wed, 18 Sep 2024 22:47:07 +0000 (+0000) Subject: Add an index over `node_announcements(seen, public_key)` X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=6aa5f492ed8ea91f49305c9a0dc44a4559f4c1f1;p=rapid-gossip-sync-server Add an index over `node_announcements(seen, public_key)` Now that we query `node_announcements` and filter by `seen` and `public_key` we should have an index over them, which we add here. --- diff --git a/src/config.rs b/src/config.rs index 6220fc1..54c7b01 100644 --- a/src/config.rs +++ b/src/config.rs @@ -163,6 +163,7 @@ pub(crate) fn db_index_creation_query() -> &'static str { CREATE UNIQUE INDEX IF NOT EXISTS channel_updates_key ON channel_updates (short_channel_id, direction, timestamp); CREATE INDEX IF NOT EXISTS channel_updates_seen ON channel_updates(seen); CREATE INDEX IF NOT EXISTS channel_updates_scid_asc_timestamp_desc ON channel_updates(short_channel_id ASC, timestamp DESC); + CREATE INDEX IF NOT EXISTS node_announcements_seen_pubkey ON node_announcements(seen, public_key); " }