Closed vindeolal closed 2 months ago
Removing voided subjects and title_lineage_locations_view or adding subject type will not fix the search performance. Some analysis details.
More analysis is required for all the different search configurations to know what all needs to be functionally working before we fix performance.
Test results: doesn't cover all cases - but covers the most commonly used cases. Since the fix that we are intending to do will not be for very specific cases and will be something that will impact all cases, didn't test more deeply. Found 2 cases not working: group subject and concept with scope program enrolment
@petmongrels the above is good enough?
Need:
Currently the search seems to take an average of 10 secs across different times and projects. Try to optmise it since this is the entry screen and hence helps to improve the users UX.
AC:
Thoughts:
Can the query to retrieve count and results be merged - it is both of these that occupy around 50% of time each (If not possible, then we can think of removing count?)
From the newrelic query it looked like we are always joining with program encounter and enrolment tables, but as per code looks otherwise. Below is the newrelic query:
Removing of sorting by subject type, date of birth, gender and title lineage?
Joins after pagination
SubjectSearchQueryBuilder
? Some joins like title_lineage_locations_view performing after pagination?to fix search for simple regular lookup and name, any of the below?
Any strategies mentioned here
Searching of observations outside of organisation context when entered?
@Searchable annotation
need to analyse the above via the execution plan of SQL to figure out the strategy
Out of scope:
Old: Ignore: