Performance: N+1 queries in renderTemplate() for category/author/tags #117
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Audit Finding
Severity: Medium
Issue:
Each call to
renderTemplate()executes separate queries for category name, author name, and tags. With 10 services, that's 30 redundant queries since the article data hasn't changed.Fix: Pre-load category, author, tags once before the service loop in
dispatch()and pass torenderTemplate().Files:
CrossPostDispatcher.phpBranch created:
feature/117-performance-n-1-queries-in-rendertemplat