Merge pull request #10260 from nextcloud/bugfix/7974/improved-sql-for-fetching-quota

Use the path_hash instead of the path to query the filecache
This commit is contained in:
Morris Jobke 2018-07-17 13:04:18 +02:00 committed by GitHub
commit a7adc4cb3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -375,7 +375,7 @@ class UserMountCache implements IUserMountCache {
->innerJoin('m', 'filecache', 'f', ->innerJoin('m', 'filecache', 'f',
$builder->expr()->andX( $builder->expr()->andX(
$builder->expr()->eq('m.storage_id', 'f.storage'), $builder->expr()->eq('m.storage_id', 'f.storage'),
$builder->expr()->eq('f.path', $builder->createNamedParameter('files')) $builder->expr()->eq('f.path_hash', $builder->createNamedParameter(md5('files')))
)) ))
->where($builder->expr()->eq('m.mount_point', $mountPoint)) ->where($builder->expr()->eq('m.mount_point', $mountPoint))
->andWhere($builder->expr()->in('m.user_id', $builder->createNamedParameter($userIds, IQueryBuilder::PARAM_STR_ARRAY))); ->andWhere($builder->expr()->in('m.user_id', $builder->createNamedParameter($userIds, IQueryBuilder::PARAM_STR_ARRAY)));