]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Add an index over `node_announcements(seen, public_key)`
authorMatt Corallo <git@bluematt.me>
Wed, 18 Sep 2024 22:47:07 +0000 (22:47 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 18 Sep 2024 22:47:07 +0000 (22:47 +0000)
Now that we query `node_announcements` and filter by `seen` and
`public_key` we should have an index over them, which we add here.

src/config.rs

index 6220fc1017bf510e812e0233a3ba275d923a4193..54c7b01465d19618d35188a8603003b70a82b716 100644 (file)
@@ -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);
        "
 }