Looks functional after having it run on a 200+ user server for a while, it got rid of the horrendous 20 hour hang caused by running the query on PostgreSQL databases and it shouldn't be any slower on MariaDB/MySQL.
I'm not really a PHP dev so excuse me if there's anything really wrong with this change :)
As per https://github.com/nextcloud/files_antivirus/issues/177#issuecomment-742831423 the query using NOT IN has been replaced with a LEFT JOIN
Looks functional after having it run on a 200+ user server for a while, it got rid of the horrendous 20 hour hang caused by running the query on PostgreSQL databases and it shouldn't be any slower on MariaDB/MySQL.
I'm not really a PHP dev so excuse me if there's anything really wrong with this change :)