mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-01 16:41:39 +01:00
graph/db+sqldb: delete channels in batches
Use the new `SLICES` directive to add a DeleteChannels query which takes a set of DB channel IDs. Then replace all our calls to DeleteChannel with a paginated call to DeleteChannels.
This commit is contained in:
@@ -569,8 +569,9 @@ WHERE c.version = $1 AND c.id > $2
|
||||
ORDER BY c.id
|
||||
LIMIT $3;
|
||||
|
||||
-- name: DeleteChannel :exec
|
||||
DELETE FROM graph_channels WHERE id = $1;
|
||||
-- name: DeleteChannels :exec
|
||||
DELETE FROM graph_channels
|
||||
WHERE id IN (sqlc.slice('ids')/*SLICE:ids*/);
|
||||
|
||||
/* ─────────────────────────────────────────────
|
||||
graph_channel_features table queries
|
||||
|
||||
Reference in New Issue
Block a user