Bug 33691 - Improve query for do_check_for_previous_checkout
Summary: Improve query for do_check_for_previous_checkout
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Kyle M Hall (khall)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-05 17:51 UTC by Kyle M Hall (khall)
Modified: 2023-05-10 14:48 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 33691: Improve query for do_check_for_previous_checkout (1.55 KB, patch)
2023-05-05 17:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 33691: Improve query for do_check_for_previous_checkout (2.21 KB, patch)
2023-05-05 17:57 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 33691: Improve query for do_check_for_previous_checkout (2.33 KB, patch)
2023-05-05 17:58 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 33691: Improve query for do_check_for_previous_checkout (2.33 KB, patch)
2023-05-05 17:59 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 33691: Improve query for do_check_for_previous_checkout (2.38 KB, patch)
2023-05-09 01:44 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2023-05-05 17:51:17 UTC
do_check_for_previous_checkout will pass a list of itemnumbers as part of the query. This could be hundreds of items or more. It makes sense to check by biblionumber instead when possible.
Comment 1 Kyle M Hall (khall) 2023-05-05 17:52:50 UTC
Created attachment 150782 [details] [review]
Bug 33691: Improve query for do_check_for_previous_checkout

do_check_for_previous_checkout will pass a list of itemnumbers as part of the query. This could be hundreds of items or more. It makes sense to check by biblionumber instead when possible.

Test Plan:
1) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
2) Apply this patch
3) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
4) Test still pass!
Comment 2 Kyle M Hall (khall) 2023-05-05 17:57:26 UTC
Created attachment 150783 [details] [review]
Bug 33691: Improve query for do_check_for_previous_checkout

do_check_for_previous_checkout will pass a list of itemnumbers as part of the query. This could be hundreds of items or more. It makes sense to check by biblionumber instead when possible.

Test Plan:
1) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
2) Apply this patch
3) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
4) Test still pass!
Comment 3 Kyle M Hall (khall) 2023-05-05 17:58:20 UTC
Created attachment 150784 [details] [review]
Bug 33691: Improve query for do_check_for_previous_checkout

do_check_for_previous_checkout will pass a list of itemnumbers as part of the query. This could be hundreds of items or more. It makes sense to check by biblionumber instead when possible.

Test Plan:
1) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
2) Apply this patch
3) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
4) Test still pass!
Comment 4 Kyle M Hall (khall) 2023-05-05 17:59:05 UTC
Created attachment 150785 [details] [review]
Bug 33691: Improve query for do_check_for_previous_checkout

do_check_for_previous_checkout will pass a list of itemnumbers as part of the query. This could be hundreds of items or more. It makes sense to check by biblionumber instead when possible.

Test Plan:
1) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
2) Apply this patch
3) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
4) Test still pass!
Comment 5 David Nind 2023-05-09 01:44:15 UTC
Created attachment 150818 [details] [review]
Bug 33691: Improve query for do_check_for_previous_checkout

do_check_for_previous_checkout will pass a list of itemnumbers as part of the query. This could be hundreds of items or more. It makes sense to check by biblionumber instead when possible.

Test Plan:
1) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
2) Apply this patch
3) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
4) Test still pass!

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Marcel de Rooy 2023-05-10 14:48:01 UTC
    my @item_nos;
[..]
        @item_nos = $biblio->items->get_column( 'itemnumber' );

And now we are fetching lots of item numbers and doing nothing with them?

Could you explain why we can miss the item numbers in general here ?