diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index 236d337ae8285..5ceb28988d078 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -290,7 +290,13 @@ protected function collectResultsFromListOfIdsQuery(IQueryBuilder $qb, array &$r public function getListOfIdsByDn(array $fdns): array { $totalDBParamLimit = 65000; $sliceSize = 1000; - $maxSlices = $this->dbc->getDatabaseProvider() === IDBConnection::PLATFORM_SQLITE ? 9 : $totalDBParamLimit / $sliceSize; + // SQLite's variable limit is very low; Oracle's OCI8 driver has high per-bind overhead, + // making large parameter lists (65k) extremely slow — use smaller batches for both. + $maxSlices = match ($this->dbc->getDatabaseProvider()) { + IDBConnection::PLATFORM_SQLITE => 9, + IDBConnection::PLATFORM_ORACLE => 5, + default => $totalDBParamLimit / $sliceSize, + }; $results = []; $slice = 1; diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php b/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php index ee5cfc36edc07..7d34ab753b35f 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php @@ -284,7 +284,7 @@ public function testGetListOfIdsByDn(): void { [$mapper,] = $this->initTest(); $listOfDNs = []; - // List size exceeds the implementation's 65000-parameter chunk limit, forcing multiple chunked queries + // List size exceeds any single-query chunk limit (65k for most DBs, 9k for SQLite, 5k for Oracle), forcing multiple chunked queries for ($i = 0; $i < 66640; $i++) { $name = 'as_' . $i; $dn = 'uid=' . $name . ',dc=example,dc=org';