1
0
mirror of https://github.com/bitwarden/server synced 2025-12-19 09:43:25 +00:00

delete ciphers in smaller batches. ref #18

This commit is contained in:
Kyle Spearrin
2016-10-20 23:04:08 -04:00
parent b04843b124
commit 2bc7799f3c

View File

@@ -6,12 +6,18 @@ BEGIN
BEGIN TRANSACTION User_DeleteById BEGIN TRANSACTION User_DeleteById
DECLARE @BatchSize INT = 100
WHILE @BatchSize > 0
BEGIN
DELETE DELETE
FROM FROM
[dbo].[Cipher] [dbo].[Cipher]
WHERE WHERE
[UserId] = @Id [UserId] = @Id
SET @BatchSize = @@ROWCOUNT
END
DELETE DELETE
FROM FROM
[dbo].[Device] [dbo].[Device]