mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 15:23:17 -04:00
Merge pull request #45214 from nextcloud/backport/45058/stable28
[stable28] perf(db): Sort data for IN before chunking
This commit is contained in:
commit
8d2502aca2
1 changed files with 3 additions and 0 deletions
|
|
@ -623,6 +623,9 @@ class Cache implements ICache {
|
|||
$query->delete('filecache')
|
||||
->whereParentInParameter('parentIds');
|
||||
|
||||
// Sorting before chunking allows the db to find the entries close to each
|
||||
// other in the index
|
||||
sort($parentIds, SORT_NUMERIC);
|
||||
foreach (array_chunk($parentIds, 1000) as $parentIdChunk) {
|
||||
$query->setParameter('parentIds', $parentIdChunk, IQueryBuilder::PARAM_INT_ARRAY);
|
||||
$query->execute();
|
||||
|
|
|
|||
Loading…
Reference in a new issue