Shared albums are slower when browsed by shared users
I have an external library with 1 million photos in 1500 folders and I would like to share it with other users. Since it is almost impossible to display these photos in the user's timeline, the best solution I found was to create albums for each folder and share them with users with the immich-folder-album-creator script, and it worked perfectly.
Now I have 1500 albums shared with users, some folders contain 6000 photos, some 100...
The problem is performance: when I open an album as a shared user, the photos load extremely slowly, while when I open albums as owner user, the loading is extremely fast.
What I noticed when I browse as a shared user is that the PostgreSQL processes are at 100% CPU, and this makes me think that it is not using the indexes of the tables.
How can I solve this issue?
Immich 1.135.3 and Postgres are in docker container with 8 cpus.
This is when i scroll photos in album as a shared user:
Now I have 1500 albums shared with users, some folders contain 6000 photos, some 100...
The problem is performance: when I open an album as a shared user, the photos load extremely slowly, while when I open albums as owner user, the loading is extremely fast.
What I noticed when I browse as a shared user is that the PostgreSQL processes are at 100% CPU, and this makes me think that it is not using the indexes of the tables.
How can I solve this issue?
Immich 1.135.3 and Postgres are in docker container with 8 cpus.
This is when i scroll photos in album as a shared user: