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

Tomás Cohen Arazi (tcohen) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #186193|0                           |1
        is obsolete|                            |

--- Comment #25 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 186802
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186802&action=edit
Bug 28702: Reduce DB lookups in buildKohaItemsNamespace

This patch moves the prefetch to current_branchtransfers and uses the
prefetched reserves
and transfers to reduce the number of lookups from the DB

We also don't fetch the specific current transfer, knowing we have current
transfers is enough

To test:
1 - Perform a search on the OPAC
2 - Add the results to a list
3 - Load the list several times and use developer tools (F12) to view the time
to load in the network tab
4 - Repeat a search several times and use developer tools (F12) to view the
time to load in the network tab
5 - Record the times noted above
6 - Find or create a record with many items, biblionumber 3 in my example
7 - on the command line:
    export DBIC_TRACE=1
    perl -e 'use C4::XSLT; my $i = C4::XSLT::buildKohaItemsNamespace( 3 );'
    note the lookups in reserves and transfers
8 - Apply patch
9 - Repeat 7 and note less lookups
10 - Repeat the search and list view and compare times to before the patch
11 - prove -v t/db_dependent/XSLT.t

Signed-off-by: Jonathan Druart <[email protected]>
Signed-off-by: Tomás Cohen Arazi <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to