-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or requestperformancePerformance optimizationPerformance optimizationpriority:highHigh priorityHigh priority
Description
Overview
Replace N+1 queries with single batch UPDATE + JOIN for dependency resolution.
Current Behavior
When a task completes, we resolve dependencies one-by-one:
for (const dependent of dependents) {
await resolveDependency(dependent.taskId, taskId, 'completed');
}Proposed Solution
Use single batch query with JOIN:
UPDATE task_dependencies
SET resolution = ?, resolved_at = ?
FROM (
SELECT task_id FROM task_dependencies WHERE depends_on_task_id = ?
) AS deps
WHERE task_dependencies.task_id = deps.task_id
AND task_dependencies.depends_on_task_id = ?;Benefits
- 7-10× faster for tasks with many dependents
- Critical for tasks with 10+ dependents
- Reduces database round trips significantly
Effort Estimate
2-4 hours
References
- ROADMAP.md v0.3.1 section
- Pre-PR review document
Priority
HIGH - Critical for production performance with complex dependency graphs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestperformancePerformance optimizationPerformance optimizationpriority:highHigh priorityHigh priority