Skip to content

Commit

Permalink
Merge pull request #29192 from owncloud/repair-step-use-path-hash
Browse files Browse the repository at this point in the history
Use path hash in selects from filecache to speed things up
  • Loading branch information
Vincent Petry authored Oct 10, 2017
2 parents 83b0cb8 + 363b0aa commit d0afb2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Repair/RepairMismatchFileCachePath.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private function fixEntryPath(IOutput $out, $fileId, $wrongPath, $correctStorage
if ($correctPath === '' && $this->connection->getDatabasePlatform() instanceof OraclePlatform) {
$qb->andWhere($qb->expr()->isNull('path'));
} else {
$qb->andWhere($qb->expr()->eq('path', $qb->createNamedParameter($correctPath)));
$qb->andWhere($qb->expr()->eq('path_hash', $qb->createNamedParameter(md5($correctPath))));
}
$entryExisted = $qb->execute() > 0;

Expand Down Expand Up @@ -373,7 +373,7 @@ private function getOrCreateEntry($storageId, $path, $reuseFileId = null) {
if ($path === '' && $this->connection->getDatabasePlatform() instanceof OraclePlatform) {
$qb->andWhere($qb->expr()->isNull('path'));
} else {
$qb->andWhere($qb->expr()->eq('path', $qb->createNamedParameter($path)));
$qb->andWhere($qb->expr()->eq('path_hash', $qb->createNamedParameter(md5($path))));
}
$results = $qb->execute();
$rows = $results->fetchAll();
Expand Down

0 comments on commit d0afb2e

Please sign in to comment.