mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 22:27:22 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user