[Koha-bugs] [Bug 31856] Improve performance of serials subscriptions search

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 25 16:11:24 CEST 2023


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

--- Comment #20 from David Gustafsson <glasklas at gmail.com> ---
(In reply to Jonathan Druart from comment #18)
> What's the purpose of this line?
> 
> 632            
> $subscriptions_by_id{$field_value->record_id}->{additional_fields}-
> >{$field_name} = $field_value->value;

Additional fields are first prefetched for all subscription. This line assigns
each additional field value to the subscription it belongs to, using a hash
where subscriptions are indexed by id. It is not obvious to me how this code
could be made more readable? Previously additional fields where fetched
repeatedly for each subscription, by fetching them all at once there is only
one database query instead of one per subscription, which is much more
efficient.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list