slow website
A long time ago I spent some time optimizing the queries and divided the times by 3. At the same time, I also experimented with using a tag association table ( https://sml.zincube.net/~niol/repositories.git/selfoss/log/?h=tag-assoc-table ) and saw that there was no performance improvement.
Implementing the *WithUnread() functions was part of this optimization. Before, there was a loop in php. Trust me it was really worth it.
Regarding optimizing this, maybe a subquery? Otherwise a cache.