https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19884
--- Comment #57 from David Gustafsson <glask...@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #55) > 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. Hi! This sounds good if I'm understanding correctly. The big win is to be able to fetch multiple biblios in batches and this resulting in only one or a few constant number of queries. If prefetch on a biblio resultset manages to do this you would probably get the same speedup. (Worth noticing is that the overhead is not on the sql-server, but almost completely in the perl-code initializing each call to Koha::Objects->find/search, so more efficient database-queries is not the primary target for improving performance, but making fewer calls to DBIx methods through batching.) -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org 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/