Skip to content

Commit

Permalink
perf(dashboard): Optimize query to fetch recent pages
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr committed Feb 12, 2025
1 parent 5d3b0da commit 4e67b74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Service/RecentPagesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public function forUser(IUser $user, int $limit = 10): array {
unset($collective);

$qb->select('p.*', 'f.mtime as timestamp', 'f.name as filename', 'f.path as path')
->from('filecache', 'f')
->leftJoin('f', 'collectives_pages', 'p', $qb->expr()->eq('f.fileid', 'p.file_id'))
->from('collectives_pages', 'p')
->innerJoin('p', 'filecache', 'f', $qb->expr()->eq('f.fileid', 'p.file_id'))
->where($qb->expr()->eq('f.storage', $qb->createNamedParameter($storageId, IQueryBuilder::PARAM_STR)))
->andWhere($qb->expr()->orX(...$expressions))
->andWhere($qb->expr()->eq('f.mimetype', $qb->createNamedParameter($mimeTypeMd, IQueryBuilder::PARAM_INT)))
Expand Down

0 comments on commit 4e67b74

Please sign in to comment.