-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More than 1000 expressions in list are not allowed on Oracle #786
Comments
Same here: QueryException: More than 1000 expressions in a list are not allowed on Oracle. "File": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", Server configuration |
This issue must have been here for some time. Batches contain a minimum of 2000 faces if the hidden setting is not changed. Confusingly, I couldn't find any code to disable batches if there are more than 25k faces, as the docs say. Also, I'm not using Oracle as the DB, but postgresql, and still get the same message as above. afaik postgresql has no limit of values for the IN clause, which Oracle have
|
I will restart indexing now. Let's see how it goes. |
Did not work... Rewrote this function in lib/Db/FaceMapper.php:
Edit: Edited to the version that works after testing and debugging. I have Postgres - might not work for mariadb or sqlite. Will update again if needed |
I'm seeing this as well (on Mariadb 10.11) and found that NextCloud upstream fixed this by pagination: https://github.com/nextcloud/server/blob/master/lib/private/Comments/Manager.php#L673 Doing it this way should work across DB platforms since it's using the Symfony backend. |
That was my initial solution as well but I thought it might reduce performance so went with the current approach instead |
I switched over to this chunk approach: public function findDescriptorsBathed (array $faceIds): array {
$qb = $this->db->getQueryBuilder();
$qb->select('id', 'descriptor')
->from($this->getTableName(), 'f')
->where($qb->expr()->in('id', $qb->createParameter('face_ids')));
$descriptors = array_fill(0, sizeof($faceIds), 0);
$arrayindex = 0;
foreach (array_chunk($faceIds, 1000) as $chunk) {
$qb->setParameter('face_ids', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
$result = $qb->executeQuery();
while ($row = $result->fetch()) {
$descriptors[$arrayindex] = [
'id' => $row['id'],
'descriptor' => json_decode($row['descriptor'])
];
$arrayindex++;
}
$result->closeCursor();
}
return $descriptors;
} |
After trying a few fancy stuff for better efficiency, I ended up implementing something similar to what you did |
This seems to have worked for me as well (on MariaDB) - Thanks! I just finished a cron run without it blowing up journald. |
Can this please be fixed with the code change as a pull request? I'm getting the exact same issue (with MariaDB). Thanks. |
Does anyone need funding to deliver these fixes or restart this project? I can furnish some. |
Hey, Thanks for reporting issues back to Nextcloud Face Recognition. Please, try to complete this report in detail so we can help you easier. 😄
Make sure you read all the documentation, and the FAQ, and that the issue has not been reported before. 😉
Expected behaviour
No error
Actual behaviour
Error logged saying more than 1000 expressions not allowed
Steps to reproduce
Server configuration
Operating system:
Unraid. AIO install
Pdlib version:
How is DLib installed: Make sure it is working correctly with this tool
Container
How is PDlib installed: Make sure it is working correctly with this tool
PHP version:
Web server:
Database: Postgres
Nextcloud version: 30
Client configuration
Browser:
Operating system:
Logs
Background task log with debug.
sudo -u apache php occ -vvv face:background_job
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: