mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
Merge pull request #54777 from nextcloud/perf/carddav/ungreedify-search
perf(carddav): ungreedify search result aggregation
This commit is contained in:
commit
38327e4493
1 changed files with 3 additions and 2 deletions
|
|
@ -1238,7 +1238,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
return (int)$match['cardid'];
|
||||
}, $matches);
|
||||
|
||||
$cards = [];
|
||||
$cardResults = [];
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('c.addressbookid', 'c.carddata', 'c.uri')
|
||||
->from($this->dbCardsTable, 'c')
|
||||
|
|
@ -1247,10 +1247,11 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
foreach (array_chunk($matches, 1000) as $matchesChunk) {
|
||||
$query->setParameter('matches', $matchesChunk, IQueryBuilder::PARAM_INT_ARRAY);
|
||||
$result = $query->executeQuery();
|
||||
$cards = array_merge($cards, $result->fetchAll());
|
||||
$cardResults[] = $result->fetchAll();
|
||||
$result->closeCursor();
|
||||
}
|
||||
|
||||
$cards = array_merge(...$cardResults);
|
||||
return array_map(function ($array) {
|
||||
$array['addressbookid'] = (int)$array['addressbookid'];
|
||||
$modified = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue