From 976288d98cc5b325dc4672a2d2be2c21287e4844 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Wed, 27 Mar 2024 19:33:06 +0100 Subject: [PATCH] Bug 36441: Add comment explaining why replacing the DBIx call --- Koha/Item.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Koha/Item.pm b/Koha/Item.pm index 7d3c9c22d5c..9917911b162 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1858,6 +1858,9 @@ Returns whether the item is a bundle or not sub is_bundle { my ($self) = @_; + # Since this is a performance critical method + # and $self->bundle_items->count is rather slow + # replace with equivalent DBI query instead my $memory_cache = Koha::Cache::Memory::Lite->get_instance; my $cache_key = 'Koha::Item:is_bundle_dbi_sth'; my $sth = $memory_cache->get_from_cache($cache_key); -- 2.43.0