--- Comment #57 from David Gustafsson <> ---
(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:
> 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
website :
git :
bugs :

Reply via email to