avniproject / avni-webapp

Web application for management and data entry
https://avniproject.org
GNU Affero General Public License v3.0
10 stars 42 forks source link

[DEA] - Search performance improvement #763

Closed vindeolal closed 1 week ago

vindeolal commented 2 years ago

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:

Out of scope:

Old: Ignore:

vinayvenu commented 2 years ago

Removing voided subjects and title_lineage_locations_view or adding subject type will not fix the search performance. Some analysis details.

  1. The search performance will improve only if we get rid of the "distinct" AND the "order by name" in the queries. Neither of these are required for the default page. Alternatively, we can default to the search page itself and not the results to fix this performance.
  2. In general, removing the "order by name" will be useful on all search results. We are anyway paginating by individual_id, so pagination will not suffer.
  3. Removing distinct will work in all cases where we search only at the subject or program enrolment level. For program enrolments, we might have a few duplicates, but I think that is ok.
petmongrels commented 3 months ago

More analysis is required for all the different search configurations to know what all needs to be functionally working before we fix performance.

mahalakshme commented 2 months ago

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

mahalakshme commented 2 months ago

@petmongrels the above is good enough?

petmongrels commented 2 months ago

Dev Notes. Core issues.