Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pro document detailed view: optimize item loading #3400

Closed
PascalRepond opened this issue Jul 10, 2023 · 0 comments
Closed

pro document detailed view: optimize item loading #3400

PascalRepond opened this issue Jul 10, 2023 · 0 comments
Assignees
Labels
developers From a developer point of view. enhancement Improvement of an existing feature performance

Comments

@PascalRepond
Copy link
Contributor

PascalRepond commented Jul 10, 2023

How it works

When loading holdings/items in the document detailed view, many ES queries are used to check the permissions for the delete buttons beacause the holdings' reasons_not_to_delete must check that all items can be deleted. For holdings with many items, this can lead to thousands of ES queries on page loading. Some of these queries are useless or redundant and could be better optimized.

Example for a document with many items: https://bib.rero.ch/professional/records/documents/detail/460668

Improvement suggestion

  1. Add a parameter to the links_to_me method allowing to not take into account the links from local_fields and use it in reasons_not_to_delete for documents, holdings and items.
  2. When calculating permissions for a holding/document, do not call reasons_not_to_delete for every item but instead build 3 ES queries (loans, fees, collections) for all items?
  3. When calculating availability in the brief views, do not call an ES query for each holding and item but instead build a query for all items/holdings at once if possible
@PascalRepond PascalRepond added enhancement Improvement of an existing feature developers From a developer point of view. labels Jul 10, 2023
@PascalRepond PascalRepond moved this from Inbox to Product Backlog in RERO ILS issues Jul 24, 2023
Garfield-fr added a commit to Garfield-fr/rero-ils-ui that referenced this issue Sep 21, 2023
Items are loaded only when we open the holdings section.

* Closes rero/rero-ils#3400.

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
@Garfield-fr Garfield-fr self-assigned this Sep 21, 2023
@Garfield-fr Garfield-fr moved this from Product Backlog to Ready to test in RERO ILS issues Sep 21, 2023
@Garfield-fr Garfield-fr moved this from Ready to test to In Development in RERO ILS issues Sep 21, 2023
@Garfield-fr Garfield-fr moved this from In Development to Ready to test in RERO ILS issues Sep 21, 2023
@PascalRepond PascalRepond moved this from Ready to test to In testing in RERO ILS issues Sep 28, 2023
@github-project-automation github-project-automation bot moved this from In testing to Done in RERO ILS issues Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developers From a developer point of view. enhancement Improvement of an existing feature performance
Projects
Archived in project
Development

No branches or pull requests

2 participants