C4::Items::GetItemsInfo(): When the items resultset is returned from the search, lots of additional queries are requested for each item in order ti get extra data. This makes large resultsets extremely slow to return. Proposed solution: Rewrite items query so it returns all relevant data at once
Created attachment 2692 [details] [review] Proposed patch
Disregard patch, has a nasty bug.
This bug is mentioned in: bug 5304: GetItemsInfo() - optimise query http://lists.koha-community.org/pipermail/koha-patches/2010-October/012696.html bug 5304: GetItemsInfo() - optimise query http://lists.koha-community.org/pipermail/koha-patches/2010-October/012697.html
Increasing the importance on this, as fixing this will improve performance.
Created attachment 29596 [details] [review] Use branch codes from the database rather than hardcoded CPL and MPL
Created attachment 29597 [details] [review] bug_5304: GetItemsInfo() - moved issues and serials query from the results loop to the main query
Testing: Biblio details pages with items need to be visited for regression check, eg opac-detail.pl and ./catalogue/detail.pl
Created attachment 29606 [details] [review] [SIGNED-OFF] Bug 5304: Use branch codes from the database rather than hardcoded CPL and MPL http://bugs.koha-community.org/show_bug.cgi?id=5304 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No commit message No test plan. prove t/db_dependent/Items.t pass No koha-qa errors
Created attachment 29607 [details] [review] [SIGNED-oFF] Bug 5304: GetItemsInfo() - moved issues and serials query from the results loop to the main query Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No commit message No test plan. No regressions found on opac/staff item display No improvements either, but could be just my test data No koha-qa errors
I forgot to add - it may be worth changing GetItemsInfo() return value to an arrayref instead of array. No big deal for biblios with a small number of items, but makes huge difference for serials with hundreds.
Created attachment 29629 [details] [review] [PASSED QA] Bug 5304: Use branch codes from the database rather than hardcoded CPL and MPL http://bugs.koha-community.org/show_bug.cgi?id=5304 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No commit message No test plan. prove t/db_dependent/Items.t pass No koha-qa errors Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 29630 [details] [review] [PASSED QA] Bug 5304: GetItemsInfo() - moved issues and serials query from the results loop to the main query Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No commit message No test plan. No regressions found on opac/staff item display No improvements either, but could be just my test data No koha-qa errors Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 29631 [details] Bug 5304: GetItemsInfo should return arrayref instead of array
(In reply to Kyle M Hall from comment #13) > Bug 5304: GetItemsInfo should return arrayref instead of array This needs a test plan please.
Kyle, that patch sort of defies purpose: my @items = @{ GetItemsInfo( $biblionumber ) }; copies the array, and the idea was to avoid that (see my comment 10). I propose we drop that patch from this ticket, let other two patches go, and open another one for this specific issue.
Created attachment 32722 [details] [review] [PASSED QA] Bug 5304: Use branch codes from the database rather than hardcoded CPL and MPL http://bugs.koha-community.org/show_bug.cgi?id=5304 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No commit message No test plan. prove t/db_dependent/Items.t pass No koha-qa errors Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32723 [details] [review] [PASSED QA] Bug 5304: GetItemsInfo() - moved issues and serials query from the results loop to the main query Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No commit message No test plan. No regressions found on opac/staff item display No improvements either, but could be just my test data No koha-qa errors Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Passes tests and QA script. Tested detail and item pages in OPAC and staff, no regressions found.
Patches pushed to master. Thanks Srdjan!