https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19884 --- Comment #55 from Tomás Cohen Arazi <tomascohen@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-ISBDdeta... 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.