Skip to content

Conversation

@icewind1991
Copy link
Member

delete entire chunk at once instead of one-by-one

@icewind1991 icewind1991 added this to the Nextcloud 30 milestone Aug 12, 2024
@icewind1991 icewind1991 requested review from a team, Altahrim, provokateurin and yemkareems and removed request for a team August 12, 2024 14:14
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
delete entire chunk at once instead of one-by-one

Signed-off-by: Robin Appelman <[email protected]>
@icewind1991 icewind1991 force-pushed the orphan-cleanup-chunk-perf branch from d3defd2 to 0f9ea19 Compare August 15, 2024 15:13
@icewind1991
Copy link
Member Author

/backport to stable30

$deletedInLastChunk = count($chunk);

$deleteQuery->setParameter('objectid', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
$deletedEntries += $deleteQuery->executeStatement();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we wrap with a transaction to make it faster?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect that that will lead to issues around transaction sizes and deadlocks

@icewind1991 icewind1991 merged commit 40c91aa into master Aug 19, 2024
@icewind1991 icewind1991 deleted the orphan-cleanup-chunk-perf branch August 19, 2024 11:40
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants