Skip to content

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

Merged
pmPaulis merged 1 commit into
epic/FOUR-32144from
feature/FOUR-32947
Oct 8, 2026
Merged

pmPaulis merged 1 commit into
epic/FOUR-32144from
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

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

@pmPaulis
pmPaulis requested a review from caleeli September 18, 2026 16:25
@pmPaulis
pmPaulis changed the base branch from develop to epic/FOUR-32144 October 6, 2026 14:18
@pmPaulis
pmPaulis merged commit c1e2d66 into epic/FOUR-32144 Oct 8, 2026
27 of 29 checks passed
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