If postgres decides walking the full `channel_updates_scid_dir_seen`
index and removing old `seen` values is slower than just walking
the full table (or this new index) it does so. Sadly this causes
re-sorting (usually on-disk), but there doesn't seem to be a way to
avoid this.
pub(crate) fn db_index_creation_query() -> &'static str {
"
+ CREATE INDEX IF NOT EXISTS channel_updates_seen ON channel_updates(seen, short_channel_id, direction) INCLUDE (id, blob_signed);
CREATE INDEX IF NOT EXISTS channel_updates_scid_seen ON channel_updates(short_channel_id, seen) INCLUDE (blob_signed);
CREATE INDEX IF NOT EXISTS channel_updates_seen_scid ON channel_updates(seen, short_channel_id);
CREATE INDEX IF NOT EXISTS channel_updates_scid_dir_seen ON channel_updates(short_channel_id ASC, direction ASC, seen DESC) INCLUDE (id, blob_signed);