[Bug 6801] New: C4::Overdues::checkoverdues returns all fields from biblio, biblioitems, items and issues
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Bug #: 6801 Summary: C4::Overdues::checkoverdues returns all fields from biblio, biblioitems, items and issues Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_6 Platform: All OS/Version: All Status: NEW Severity: major Priority: P5 Component: Architecture, internals, and plumbing AssignedTo: ian.walls@bywatersolutions.com ReportedBy: ian.walls@bywatersolutions.com QAContact: koha-bugs@lists.koha-community.org checkoverdues is used solely by C4::Members::patronflags to determine if a borrower has any overdues; if so, the ODUE flag is added to their and the list of overdues returned. This winds up being fed to GetMemberDetails, and some of the calls then use the overdue items... sometimes. Removing the marc and marcxml blobs would greatly speed up the return of this function, which can cause slowness for patrons with many, many checkouts (or with relatives with many, many checkouts). -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 --- Comment #1 from Ian Walls <ian.walls@bywatersolutions.com> 2011-08-31 18:46:15 UTC --- Created attachment 5244 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5244 Proposed Patch Removes biblioitems.marc and biblioitems.marcxml from the checkoverdues SQL query. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #2 from Liz Rea <wizzyrea@gmail.com> 2011-08-31 19:27:05 UTC --- I'm sad to report that a problematic patron (one with 73 checkouts, all overdue) still takes over a minute to load, even with this patch. *sadface* -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 --- Comment #3 from Ian Walls <ian.walls@bywatersolutions.com> 2011-08-31 22:46:59 UTC --- More research has led to the REAL root of the problem Liz is experiencing; it's not so much that checkoverdues is inefficient, but that it's being called WAY too often now that Relatives Checkouts are in place (it's called once for every issue checked out to the person or to their relatives). On this particular issue, however, looking at how the returned values of checkoverdues are actually used, we only need to return itemnumber and date_due from the issues table (or anything extra we'd like to show over a SIP2 connection, once that functionality is added). This would greatly shorten the query time, which is never a bad thing. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Patch Status|Needs Signoff |--- Summary|C4::Overdues::checkoverdues |Patron details page slow to |returns all fields from |load when many checkouts |biblio, biblioitems, items |present |and issues | --- Comment #4 from Ian Walls <ian.walls@bywatersolutions.com> 2011-09-22 11:28:40 UTC --- Updating the bug report title to reflect the real problem; solution forthcoming. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 --- Comment #5 from Ian Walls <ian.walls@bywatersolutions.com> 2011-09-22 15:03:37 UTC --- Created attachment 5541 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5541 Second Proposed Patch This patch extends the work done by the first: Adds borrower firstname, surname and cardnumber to GetPendingIssues() return value. Removes calls to GetMemberDetails in build_issue_data subroutines of members/moremember.pl and circ/circulation.pl Change templates to use "[% scope.firstname %] [% scope.surname %]" instead of [% scope.borrowername %] Changes borrowernumber source in build_issue_data()'s checks for GetIssuingCharges() and CanBookBeRenewed(). Instead of using the borrowernumber for the page, use the borrowernumber for that specific issue. In current usage, this will be no different, but in theory for any Relatives Checkouts making use of this data, the issuing charges and renewal permission could be incorrect. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 --- Comment #6 from Liz Rea <wizzyrea@gmail.com> 2011-09-22 15:37:16 UTC --- Created attachment 5544 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5544 Bug 6801: checkoverdues returns unnecessary fields, causing slowness Explicitly specifies which fields to return in C4::Overdues::checkoverdues SQL: all of biblio, items, and issues, and everything in biblioitems EXCEPT marc, marcxml and timestamp. Bug 6801: member details page taking long time to load when many checkouts present This patch removes the call to GetMemberDetails in build_issue_data; this heavy-weight subroutine was being run for every single item a patron (or their relatives) have checked out. Instead, the borrowers first name, surname and cardnumber are added to the GetPendingIssues query. I believe this is reasonable since GetPendingIssues can now return issues for multiple borrowers. Also corrects the $borrowernumber used for GetIssuesCharges and CanItemBeRenewed; was using the borrower whose page we were on, NOT the borrower of that specific item (which would be different in the Relatives Checkouts tab). Template calls to [% scope.borrowername %] are now broken up into [% scope.firstname %] [% scope.surname %]. Signed-off-by: Liz Rea <lrea@nekls.org> On my test data, a patron with 180 checkouts (without this patch) would take more than a minute to bring back the circulation.pl and moremember.pl pages. With this patch, the time is reduced to 5 or so seconds. Big ups to Ian for tenaciously hunting this one down. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Needs Signoff |Signed Off --- Comment #7 from Liz Rea <wizzyrea@gmail.com> 2011-09-22 15:38:19 UTC --- Squashed these two together at Ian's request. They both get my sign off. One other sign off might be nice, since Ian wrote this thing. ;) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5244|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5541|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 --- Comment #8 from Ian Walls <ian.walls@bywatersolutions.com> 2011-09-22 15:48:33 UTC --- Another set of eyes is most thoroughly appreciated; I'll refrain from pushing this through QA immediately until someone else has had the opportunity to test. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5544|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> 2011-09-26 20:15:10 UTC --- Created attachment 5598 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5598 [SIGNED-OFF] Bug 6801: checkoverdues returns unnecessary fields, causing slowness Explicitly specifies which fields to return in C4::Overdues::checkoverdues SQL: all of biblio, items, and issues, and everything in biblioitems EXCEPT marc, marcxml and timestamp. Bug 6801: member details page taking long time to load when many checkouts present This patch removes the call to GetMemberDetails in build_issue_data; this heavy-weight subroutine was being run for every single item a patron (or their relatives) have checked out. Instead, the borrowers first name, surname and cardnumber are added to the GetPendingIssues query. I believe this is reasonable since GetPendingIssues can now return issues for multiple borrowers. Also corrects the $borrowernumber used for GetIssuesCharges and CanItemBeRenewed; was using the borrower whose page we were on, NOT the borrower of that specific item (which would be different in the Relatives Checkouts tab). Template calls to [% scope.borrowername %] are now broken up into [% scope.firstname %] [% scope.surname %]. Signed-off-by: Liz Rea <lrea@nekls.org> On my test data, a patron with 180 checkouts (without this patch) would take more than a minute to bring back the circulation.pl and moremember.pl pages. With this patch, the time is reduced to 5 or so seconds. Big ups to Ian for tenaciously hunting this one down. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Signed Off |Patch Pushed --- Comment #10 from Chris Cormack <chris@bigballofwax.co.nz> 2011-09-26 20:52:25 UTC --- Pushed to master, with a borrower with 286 checkouts the load time dropped from 108858ms to 4075ms. This was after restarting mysql to get rid of any query caching. A dramatic improvement. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6801 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED --- Comment #11 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- Appears to be working fine. Closing. -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org