[Koha-bugs] [Bug 30169] Prefetching is expensive for performance

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 24 16:22:58 CET 2022


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

Julian Maurice <julian.maurice at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |julian.maurice at biblibre.com

--- Comment #2 from Julian Maurice <julian.maurice at biblibre.com> ---
Can confirm, and the issue is not with Koha::Objects because using DBIC
directly shows the same problem:

# 163..212 is just the range of itemnumbers I had in my issues table

time perl -e 'use Koha::Database; my $schema = Koha::Database->schema; for
(163..212) { my $issue = $schema->resultset("Issue")->find({itemnumber => $_},
{prefetch => ["item", "patron"]}); my $info = $issue->item->barcode .
$issue->patron->firstname }'

perl -e   1,55s user 0,06s system 97% cpu 1,646 total


time perl -e 'use Koha::Database; my $schema = Koha::Database->schema; for
(163..212) { my $issue = $schema->resultset("Issue")->find({itemnumber => $_},
{prefetch => []}); my $info = $issue->item->barcode . $issue->patron->firstname
}' 

perl -e   1,04s user 0,06s system 96% cpu 1,138 total

I ran both commands multiple times and had the same times

It's weird, as I have seen some improvements in other areas by using prefetch
(see bug 30004)

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list