Skip to content

perf(FOUR-32947): reduce N+1 queries on requests listing (FOUR-32947) - #9036

Open
gproly wants to merge 1 commit into
developfrom
feature/FOUR-32947
Open

perf(FOUR-32947): reduce N+1 queries on requests listing (FOUR-32947)#9036
gproly wants to merge 1 commit into
developfrom
feature/FOUR-32947

Conversation

@gproly

@gproly gproly commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Batch-load listing relations after pagination to avoid per-row queries for process version alternative, active tasks, process categories, and project assets while preserving the existing API response shape.

  • Add ProcessRequestListingRawRepository to hydrate activeTasks (raw SQL) and process data (Eloquent + batched projects/categories)
  • Use withAggregate for process_version_alternative and read it without lazy-loading ProcessVersion
  • Add activeTasks relation and use preloaded data in ProcessRequests
  • Preload projects JSON and reuse loaded categories in Process accessors
  • Apply hydration in index and getRequestsByCase
  • Add bounded query-count feature test

https://processmaker.atlassian.net/browse/FOUR-32947

ci:deploy

Batch-load listing relations after pagination to avoid per-row queries
for process version alternative, active tasks, process categories, and
project assets while preserving the existing API response shape.

- Add ProcessRequestListingRawRepository to hydrate activeTasks (raw SQL)
  and process data (Eloquent + batched projects/categories)
- Use withAggregate for process_version_alternative and read it without
  lazy-loading ProcessVersion
- Add activeTasks relation and use preloaded data in ProcessRequests
- Preload projects JSON and reuse loaded categories in Process accessors
- Apply hydration in index and getRequestsByCase
- Add bounded query-count feature test

https://processmaker.atlassian.net/browse/FOUR-32947
@decisions-sonarqube

Copy link
Copy Markdown

@nolanpro

nolanpro commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://ci-27a7a57b03.engk8s.processmaker.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants