Open juliushaertl opened 2 months ago
The following query does not seem ot use an index and do a full table scan on the albums table:
https://github.com/nextcloud/photos/blob/2376b7d81d102272917fec65a4a933a07c3136e0/lib/Album/AlbumMapper.php#L138-L146
From a brief look it should be possible to refactor it to query the oc_photos_albums_files first to then get only the albums using an inner join
The following query does not seem ot use an index and do a full table scan on the albums table:
https://github.com/nextcloud/photos/blob/2376b7d81d102272917fec65a4a933a07c3136e0/lib/Album/AlbumMapper.php#L138-L146
From a brief look it should be possible to refactor it to query the oc_photos_albums_files first to then get only the albums using an inner join