Koha/C4
Kyle M Hall 665c5c62fa Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds
If the AllowRenewalIfOtherItemsAvailable sys pref is set to allow, and a
borrower has an item checked out that has many items {30+} AND many
holds {70+) on it, loading the checkouts table for this borrower takes
FOREVER to load. The load time takes forever, because of the
factoring that happens to determine if an item is truly
available for renewal.

This patch swaps the use of GetMemberDetails for GetMember
and reorders the subroutine calls to check each items' renewability
from fastest to slowest.

In a test case, the results of pre patch were:
Start of loop: 2016-08-24T11:05:14
End of loop:   2016-08-24T11:05:29
Resulting in 15 seconds being spent in the loop

Post patch results were:
Start of loop: 2016-08-24T11:08:43
End of loop:   2016-08-24T11:08:48
Resulting in only 5 seconds being spent in the loop!

Test Plan:
1) Apply this patch
2) Note there are no changes in functionality for the renewals column of
   the patron checkouts table.

If you wish to go further and test the performance benefit:
1) Create a record with 50 items and 100 holds ( 50 waiting, 50 unfilled )
2) Check out one of the waiting holds to a patron
3) Time the amount of time it takes for the checkouts table to load
4) Apply this patch
5) Repeat step 3, you should see an improvement in load time

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:57:01 +00:00
..
AuthoritiesMarc
Barcodes Bug 14752 - (QA followup) Remove annoying modal, use dialog box instead 2016-09-13 17:21:05 +00:00
Bookseller Bug 5260 - Add option to send an order by e-mail to the acquisition module 2016-10-28 11:52:25 +00:00
ClassSortRoutine
Creators Bug 17301 - Add callnumber to label-edit-batch.pl 2016-09-25 15:49:10 +00:00
External Bug 17189: Replace occurrences of 'use Koha::Cache' 2016-09-08 10:24:47 +00:00
Form
Heading
ILSDI Bug 10455: (follow-up 2) Remove biblioitems.marc 2016-10-21 14:35:00 +00:00
Installer Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher 2016-10-28 11:58:14 +00:00
Labels Bug 15758: Koha::Libraries - Remove GetBranchName 2016-09-08 14:36:01 +00:00
Linker
Members Bug 10227 : Fix GetMessagingPreferences when digest is possible 2016-09-13 17:14:28 +00:00
OAI
Output
Patroncards
Reports Bug 17535: Fix search for reports by keywords 2016-11-07 16:38:25 +00:00
Search Bug 17323: Column search_history.time cannot be null 2016-11-18 13:51:37 +00:00
Serials
SIP Bug 15901 - Remove use of recordpayment in C4::SIP::ILS::Transaction::FeePayment 2016-09-27 13:52:34 +00:00
Utils Bug 14874: Set default DefaultPatronSearchFields 2016-10-27 13:21:13 +00:00
Accounts.pm Bug 15899 - Remove C4::Accounts::recordpayment 2016-09-27 13:55:12 +00:00
Acquisition.pm Bug 17563: (followup) Silence undef warnings 2016-11-10 13:36:48 +00:00
Auth.pm Bug 16276: [QA Follow-up] Only track when pref is enabled 2016-09-13 17:27:43 +00:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication) 2016-11-07 16:34:57 +00:00
Auth_with_ldap.pm
Auth_with_shibboleth.pm
AuthoritiesMarc.pm
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 10455: (follow-up) Remove biblioitems.marc 2016-10-21 14:34:59 +00:00
Bookseller.pm Bug 13321: Rename variables 2016-10-28 13:45:59 +00:00
Boolean.pm
Breeding.pm
Budgets.pm Bug 16123 - Display budget hierarchy in the budget dropdown menu used when placing a new order 2016-10-28 15:26:00 +00:00
Calendar.pm Bug 17189: Replace occurrences of 'use Koha::Cache' 2016-09-08 10:24:47 +00:00
Charset.pm
Circulation.pm Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds 2016-11-18 13:57:01 +00:00
ClassSortRoutine.pm
ClassSource.pm
Context.pm Bug 16520 - (Follow up) Restore retrieval of syspref_cache 2016-11-15 14:09:33 +00:00
Contract.pm
CourseReserves.pm
Creators.pm
Debug.pm
Heading.pm
HoldsQueue.pm Bug 14514 - LocalHoldsPriority and the HoldsQueue conflict with each other 2016-10-11 15:44:47 +00:00
HTML5Media.pm Bug 17231 - (QA Followup) 2016-09-08 12:06:47 +00:00
Images.pm
ImportBatch.pm Bug 6852: Staged import reports wrong success for items 2016-09-12 08:55:41 +00:00
ImportExportFramework.pm Bug 17389: Clear logs 2016-10-11 16:18:10 +00:00
InstallAuth.pm
Installer.pm Bug 17216: Move the AV cat list file to the top level 2016-10-11 07:30:33 +00:00
ItemCirculationAlertPreference.pm Bug 15407: Koha::Patron::Categories - replace C4::Category->all 2016-09-08 13:29:03 +00:00
Items.pm Bug 14598 [QA Followup] - Correct the behavior of GetItem 2016-10-28 11:29:58 +00:00
Koha.pm Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories 2016-10-28 16:35:52 +00:00
Labels.pm
Languages.pm
Letters.pm Bug 5260: QA follow-up: Fix error when no notice template is defined 2016-10-28 11:52:26 +00:00
Linker.pm
Log.pm
MarcModificationTemplates.pm
Matcher.pm Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher 2016-10-28 11:58:14 +00:00
Members.pm Bug 15690: Hardcoded 16 is uncool 2016-11-14 11:28:43 +00:00
Message.pm
NewsChannels.pm
Output.pm
Overdues.pm Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule 2016-11-15 15:41:43 +00:00
Patroncards.pm
Print.pm
Record.pm Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field 2016-10-21 15:13:56 +00:00
Reports.pm
Reserves.pm Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule 2016-11-15 15:41:43 +00:00
Ris.pm Bug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel 2016-10-21 14:51:55 +00:00
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm Bug 17253: Koha::AuthorisedValues - Remove GetKohaAuthorisedValues 2016-10-21 15:35:34 +00:00
Serials.pm Bug 9896 - Show vendor in subscription search when creating an order for a subscription 2016-09-25 14:09:56 +00:00
Service.pm
ShelfBrowser.pm Bug 15758: Koha::Libraries - Remove GetBranches 2016-09-08 14:36:03 +00:00
SMS.pm
SocialData.pm
Stats.pm
Suggestions.pm
Tags.pm
Templates.pm
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 15131: Add AllowItemsOnHoldCheckoutSCO to UsageStats 2016-10-21 17:27:07 +00:00
XISBN.pm
XSLT.pm Bug 17435: Gives ability to display stocknumber in search results 2016-10-28 11:49:18 +00:00