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

--- Comment #1 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 202108
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202108&action=edit
Bug 43102: Koha::Items filters inline every itemnumber of the set as an OR
chain

filter_by_checked_out, filter_by_in_transit, filter_by_has_holds and
filter_by_has_recalls already restrict the final search with an IN
subquery, but the subquery itself is built by fetching every itemnumber
of the set into memory and passing the list as an arrayref that
SQL::Abstract renders as one OR clause per itemnumber. For a records
with large numbers of items this can produce very large queries.

This patch passes the itemnumbers as a subquery so the database
resolves the set itself. Existing unit tests should prove there
is no change in behavior.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Items.t
3) Note all tests pass!

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to