Performance: CrossPostDispatcher makes N*M DB queries per dispatch #99

Open
opened 2026-05-29 05:30:32 +00:00 by jmiller · 1 comment
Owner

Audit Finding H-11

Severity: Medium

Issue:
For each service (N), the dispatcher runs a duplicate guard query AND a template query. With 10 services, that's 20+ queries per article publish.

Fix: Batch the duplicate guard check into a single query that returns all existing article+service pairs. Batch template loading similarly.

Files: CrossPostDispatcher.php

Label: priority: medium, type: performance

## Audit Finding H-11 **Severity:** Medium **Issue:** For each service (N), the dispatcher runs a duplicate guard query AND a template query. With 10 services, that's 20+ queries per article publish. **Fix:** Batch the duplicate guard check into a single query that returns all existing article+service pairs. Batch template loading similarly. **Files:** `CrossPostDispatcher.php` **Label:** `priority: medium`, `type: performance`
Author
Owner

Branch created: feature/99-performance-crosspostdispatcher-makes-n-

git fetch origin
git checkout feature/99-performance-crosspostdispatcher-makes-n-
Branch created: [`feature/99-performance-crosspostdispatcher-makes-n-`](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomCross/src/branch/feature/99-performance-crosspostdispatcher-makes-n-) ```bash git fetch origin git checkout feature/99-performance-crosspostdispatcher-makes-n- ```
Sign in to join this conversation.
Type Task
Status
Priority
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomCross#99