https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38867 Bug ID: 38867 Summary: Optimize Koha::Items->filter_by_for_hold for search Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org There are cases where Koha::Items->filter_by_for_hold() is only called 1 time in a HTTP response (e.g. on the various OPAC detail pages or the staff interface cat-toolbar.inc), but in the search results it's called N times where N is the number of records rendered on the page. This can drastically increase the number of queries going to the DB. Out of the box, numSearchResults and OPACnumSearchResults are set to 20, but an admin can set it much higher. I was monitoring a long running search requests where numSearchResults was set to 1000, and many of the queries I saw were from this one function. That said, I didn't get a chance to look at the actual execution time for these queries. Considering what the queries are, chances are most of the time was lost on the "items" and "reserves" table. However, it never hurts to reduce DB queries, especially when the volume of queries increases with the volume of search results. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.