FOUR-21555 Performance backend improvements by julceslauhub · Pull Request #7961 · ProcessMaker/processmaker

Issue & Reproduction Steps

When the table "process_requests" have more than 100,000 records, the endpoints that returns the totals takes more than 2 seconds to respond.

Solution

Added a new index for "process_requests" for the fields: 'process_id', 'status', 'user_id', with this new index the response takes 300-400 ms in my local server

How to Test

Go to "My Requests" lists and check the server timing for endpoint: https://127.0.0.1/api/1.0/requests?total=true&pmql=(status%20=%20%22In%20Progress%22)%20AND%20(requester%20=%20%22admin%22)

Related Tickets & Packages

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

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.