Skip to content

Commit ca813c0

Browse files
committed
sqldb/sqlc: add index on graph_channels(version, id)
1 parent 0bbe463 commit ca813c0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sqldb/sqlc/migrations/000007_graph.down.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DROP INDEX IF EXISTS graph_channels_node_id_1_idx;
99
DROP INDEX IF EXISTS graph_channels_node_id_2_idx;
1010
DROP INDEX IF EXISTS graph_channels_unique;
1111
DROP INDEX IF EXISTS graph_channels_version_outpoint_idx;
12+
DROP INDEX IF EXISTS graph_channels_version_id_idx;
1213
DROP INDEX IF EXISTS graph_channel_features_unique;
1314
DROP INDEX IF EXISTS graph_channel_extra_types_unique;
1415
DROP INDEX IF EXISTS graph_channel_policies_unique;

sqldb/sqlc/migrations/000007_graph.up.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ CREATE TABLE IF NOT EXISTS graph_channels (
173173
-- indexes on the node_id_1 and node_id_2 columns.
174174
CREATE INDEX IF NOT EXISTS graph_channels_node_id_1_idx ON graph_channels(node_id_1);
175175
CREATE INDEX IF NOT EXISTS graph_channels_node_id_2_idx ON graph_channels(node_id_2);
176+
CREATE INDEX graph_channels_version_id_idx ON graph_channels(version, id);
176177

177178
-- A channel (identified by a short channel id) can only have one active
178179
-- channel announcement per protocol version. We also order the index by

0 commit comments

Comments
 (0)