During T421877: Intended for reuse flag - inferred from intended use data we noticed that our logic in PublicWikiController resulted in an unnecessary amount of database queries being executed.
This is likely due to us doing lazy loading of Eloquent Models rather than eager loading.
Some related reading: https://laravel-news.com/laravel-n1-query-problems
We should investigate what other areas of our codebase suffer from this issue and create subtasks to address them.