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

--- Comment #12 from Pedro Amorim (ammopt) <[email protected]> ---
Created attachment 200609
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200609&action=edit
Bug 42835: OPAC performance: Batch item visibility check to reduce N+1 DB
queries

Before the main result loop, pre-scan all MARC records for the current
page to collect every itemnumber in one pass. Run a single batched
filter_by_visible_in_opac call and store the result in a hash. The inner
item loop then does a plain hash lookup instead of one Koha::Items DB
query per item, reducing N queries to 1 per page load.

Falls back to the per-item path if no itemnumbers are found in the
pre-scan.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to