graph/db+sqldb: improve performance of chan update sql migration

This commit simplifies insertChanEdgePolicyMig. Much of the logic can be
removed given that this method is only used in the context of the graph
SQL migration.

This should improve the performance of the migration quite a lot since
it removes the extra GetChannelAndNodesBySCID call.
This commit is contained in:
Elle Mouton committed 2025-09-01 08:07:57 +02:00
1 parent 22bf88e900
commit f2ed5564ef
5 files changed
+66 -79

No files matched your search

+6 -2
View File
@@ -869,11 +869,15 @@ WHERE c.scid = @scid
─────────────────────────────────────────────
*/
-- name: InsertChanPolicyExtraType :exec
-- name: UpsertChanPolicyExtraType :exec
INSERT INTO graph_channel_policy_extra_types (
channel_policy_id, type, value
)
VALUES ($1, $2, $3);
VALUES ($1, $2, $3)
ON CONFLICT (channel_policy_id, type)
-- If a conflict occurs on channel_policy_id and type, then we update the
-- value.
DO UPDATE SET value = EXCLUDED.value;
-- name: GetChannelPolicyExtraTypesBatch :many
SELECT