[Koha-bugs] [Bug 26587] New: detail.pl is very slow for records with many items

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 1 04:56:22 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

            Bug ID: 26587
           Summary: detail.pl is very slow for records with many items
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Cataloging
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: dcook at prosentient.com.au
        QA Contact: testopia at bugs.koha-community.org
                CC: m.de.rooy at rijksmuseum.nl

Using Plack Koha, it took about 10 seconds to load detail.pl for a page with
350 items.

Looking at the code, we loop through order, subscriptions, and items.

I haven't done any benchmarking, but my guess would be the slowdown comes when
looping through the items, as there are lots of database calls made in that
loop.

I think optimizations come down to the following (which are not mutually
exclusive):

1. Get the full count of items but only lookup/render a subset using an AJAX
call 
2. Use fewer database calls in the loop by fetching all the data needed from
the database and then processing it as necessary in the loop
3. Use fewer external cache lookups by doing things like
C4::Context->preference('UseCourseReserves') outside of the loop rather than
inside the loop

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list