]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Add some further indexes on channel_updates to match queries
authorMatt Corallo <git@bluematt.me>
Tue, 13 Sep 2022 00:07:49 +0000 (00:07 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 13 Sep 2022 16:17:40 +0000 (16:17 +0000)
src/config.rs

index cd7a09d265d2b5b331c8ee8146950d914ba0a233..5369e8d04c89bf15eda6e1a4f76eb25a319c3521 100644 (file)
@@ -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);
        "
 }