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

--- Comment #2 from Marcel de Rooy <[email protected]> ---
The code in opac-shelves is far from optimal. The prefetch in the query selects
biblio, biblioitems and items. But in the loop starting at L308 we are calling
GetBiblioData, GetMarcBiblio, Biblios->find, GetItemsLocationInfo,
$biblio->items. Horrible ;)

DBIx says about prefetching and collapse the following:
If an "order_by" is already declared, and orders the resultset in a way that
makes collapsing as described above impossible (e.g. ORDER BY
has_many_rel.column or ORDER BY RANDOM()), DBIC will automatically switch to
"eager" mode and slurp the entire resultset before constructing the first
object returned by "next".

So if we are 'sorting' by itemcallnumber in an "has many" table, we will
trigger the warning. In that case we can remove the sort anyway.

This is a bit lazy 'solution' but this report was not about refactoring
opac-shelves.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
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/

Reply via email to