[Koha-bugs] [Bug 19884] Improve performance of GetItem
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Oct 10 14:36:26 CEST 2019
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19884
--- Comment #55 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Hi David, I haven't been following this thread in full, but I suggest you take
a look at this line of code:
http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=opac/opac-ISBDdetail.pl;h=c79167cd31274cf115e99293bdd7fa7716c3d88d;hb=HEAD#l63
You will notice that there's actually a prefetch of the related metadata row
and the (maybe multiple) items rows in the same query (through a LEFT JOIN).
The same approach can be used for a resultset (i.e. not just a ->find returning
a single Koha::Biblio).
You can then acccess (without further queries to the DB) the MARC record
through:
$biblio->metadata->record
I think the only missing thing here, would be a Koha::RecordProcessor filter
(EmbedItems) that would take this resultset (so no new queries) and does the
same thing your original code did.
In short: heavy use of prefetch, and abandon the C4::Biblio and C4::Items
routines. If you agree I could write the RecordProcessor filter.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list