Summary: | Moredetail.tt page is opening very slowly | ||
---|---|---|---|
Product: | Koha | Reporter: | Johanna Räisä <johanna.raisa> |
Component: | Cataloging | Assignee: | Johanna Räisä <johanna.raisa> |
Status: | Pushed to oldstable --- | QA Contact: | Emily Lamancusa (emlam) <emily.lamancusa> |
Severity: | normal | ||
Priority: | P5 - low | CC: | danielle.elder, david, emily.lamancusa, fridolin.somers, lucas, m.de.rooy, wainuiwitikapark |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This improves the loading time of a record's items page in the staff item when there are many items and check-outs.
|
Version(s) released in: |
24.11.00,24.05.04,23.11.10
|
Circulation function: | |||
Bug Depends on: | 35310 | ||
Bug Blocks: | |||
Attachments: |
Bug 37591: fix moredetail.tt performance issue
A script to add checkouts and renewals Bug 37591: fix moredetail.tt performance issue Bug 37591: fix moredetail.tt performance issue |
Description
Johanna Räisä
2024-08-07 11:57:59 UTC
I figured out where the problem is. It is actually in the moredetail.tt and appeared after this Bug 35310. The view starts fetching renewals for checkouts and if there are lot of renewals for each of the item the page load takes lot of time. The count should probably made in the background, using objects on the views is causing performance issues. Created attachment 170168 [details] [review] Bug 37591: fix moredetail.tt performance issue This patch fixes the performance issue in moredetail.tt by removing the unnecessary call of checkout_renewals table. To test: 1. Create lot of checkouts and renewals for a record. 2. Open the moredetail page for the record. 3. Check the timing of the page load. 4. Apply the patch and check the timing of the page load again. 5. The page load should be faster after applying the patch. Sponsored-by: Koha-Suomi Oy Created attachment 170169 [details]
A script to add checkouts and renewals
This bug is a bit hard to test. You will need lot of checkouts and data in the checkout_renewals table. In our case we have over 3 million rows in the checkout_renewals table and page load was over 2 minutes and it got reduced to 5 seconds after this patch.
I made a script which you can use for testing.
Created attachment 170240 [details] [review] Bug 37591: fix moredetail.tt performance issue This patch fixes the performance issue in moredetail.tt by removing the unnecessary call of checkout_renewals table. To test: 1. Create lot of checkouts and renewals for a record. 2. Open the moredetail page for the record. 3. Check the timing of the page load. 4. Apply the patch and check the timing of the page load again. 5. The page load should be faster after applying the patch. Sponsored-by: Koha-Suomi Oy Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 170294 [details] [review] Bug 37591: fix moredetail.tt performance issue This patch fixes the performance issue in moredetail.tt by removing the unnecessary call of checkout_renewals table. To test: 1. Create lot of checkouts and renewals for a record. 2. Open the moredetail page for the record. 3. Check the timing of the page load. 4. Apply the patch and check the timing of the page load again. 5. The page load should be faster after applying the patch. Sponsored-by: Koha-Suomi Oy Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Thanks for the test script, Johanna! Starting from default KTD data and creating a bib with 2,000 items x 4 renewals each, I can confirm an improvement from 22.58s without the patch to 13.45s with the patch. The code and QA tool also look good - passing QA. Pushed for 24.11! Well done everyone, thank you! Backported to 24.05.x for upcoming 24.05.04 Pushed to 23.11.x for 23.11.10 Not backporting to 23.05.x unless requested |