OwlPlug icon indicating copy to clipboard operation
OwlPlug copied to clipboard

Reduce the number of queries to retrieve stored data

Open DropSnorz opened this issue 1 year ago • 0 comments

Since most calls to the data storage (h2) are now using JPA criteria API, most annotations on the model like FetchType.EAGER are ignored.

Entity fetching must be managed at the repository/DAO level. Now, there are some N+1 queries triggered that can impact performances for large Plugin , Project or Packages collections.

Queries must be optimized with following priority:

  1. Plugins related queries
  2. Daw Project related queries
  3. Packages (Explore Tab) related queries

For Packages, implementing pagination at the data fetching level can also improve performance. The pagination is implemented at UI level for now. This change is out of scope for this issue.

For Packages, multiple child lists must be resolved. Multiple subqueries can be used following recommendations in this SO thread : https://stackoverflow.com/questions/4334970/hibernate-throws-multiplebagfetchexception-cannot-simultaneously-fetch-multipl/51055523#51055523

DropSnorz avatar Aug 18 '24 14:08 DropSnorz