Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching photo albums is slow because of many albums without covers #3887

Open
ColonelPhantom opened this issue Jan 15, 2025 · 1 comment
Open
Labels
optimization Issues regarding slowness priority: low Should be dealt with when nothing else remains.

Comments

@ColonelPhantom
Copy link
Contributor

What?

Pages that fetch photo albums (/members/photos and /api/v2/photos/albums) are often slow, because they need to fetch cover images. When no cover image is set, two(!) queries are performed, one to check if there are photos (???) and one to select a random image.

Why?

Performance intensive; /api/v2/photos/albums often takes over 1 second.

How?

At the very least, do not use the exists check since it should always pass. Preferably, do something to cover images, e.g. make we could maybe make it non-optional?

@ColonelPhantom ColonelPhantom added priority: low Should be dealt with when nothing else remains. optimization Issues regarding slowness labels Jan 15, 2025
@DeD1rk
Copy link
Member

DeD1rk commented Jan 22, 2025

#3889 makes the situation much better. For a real solution, I suggest we just save the cover that would be selected randomly to the _cover field in Album.save(). (no need to change the schema as it probably should have SET_NULL).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Issues regarding slowness priority: low Should be dealt with when nothing else remains.
Projects
None yet
Development

No branches or pull requests

2 participants