https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30169 Bug ID: 30169 Summary: Prefetching is expensive for performance Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org When working on bug 30168 I checked out 500 items to a patron to test performance I found that after adding the prefetch, things were worse. Testing on command line seems to suggest prefetch is worse than repeated fetches time perl -e 'use Koha::Checkouts; for( my $i=0;$i<500;$i++){ Koha::Checkouts->find({itemnumber=>541}) } print "2\n";' 2 real 0m1.850s user 0m1.701s sys 0m0.096s root@kohadevbox:koha(master)$ time perl -e 'use Koha::Checkouts; for( my $i=0;$i<500;$i++){ Koha::Checkouts->find({itemnumber=>541},{prefetch => ['itemnumber','borrowernumber']}) } print "2\n";' 2 real 0m10.770s user 0m10.452s sys 0m0.104s root@kohadevbox:koha(master)$ time perl -e 'use Koha::Checkouts; for( my $i=0;$i<500;$i++){ my $co =Koha::Checkouts->find({itemnumber=>541},{prefetch => ['itemnumber','borrowernumber']}); my $item = $co->item; my $pat = $co->patron } print "2\n";' 2 real 0m13.153s user 0m12.600s sys 0m0.140s root@kohadevbox:koha(master)$ time perl -e 'use Koha::Checkouts; for( my $i=0;$i<500;$i++){ my $co =Koha::Checkouts->find({itemnumber=>541}); my $item = $co->item; my $pat = $co->patron } print "2\n";' 2 real 0m3.873s user 0m3.493s sys 0m0.139s -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.