From 774d4e9ab4ebb44fc31045a5b5b5ca31d8f52b59 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 18 Nov 2020 10:42:39 +0100 Subject: [PATCH] Bug 24488: perf - Group by at DBMS level Signed-off-by: Michal Denar Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- circ/pendingreserves.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index d9a5107e74..0bc6995768 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -185,11 +185,10 @@ if ( C4::Context->preference('IndependentBranches') ){ } # get all distinct unfulfilled reserves -my $distinct_holds = Koha::Holds->search( +my @biblionumbers = Koha::Holds->search( { %where }, - { join => 'itembib', alias => 'reserve', columns => [ 'biblionumber' ] } -); -my @biblionumbers = uniq $distinct_holds->get_column('biblionumber'); + { join => 'itembib', alias => 'reserve', distinct => 1, columns => qw[me.biblionumber] } +)->get_column('biblionumber'); my @branchtransfers = map { $_->itemnumber } Koha::Item::Transfers->search({ datearrived => undef }, { columns => [ 'itemnumber' ], collapse => 1 }); my @waiting_holds = map { $_->itemnumber } Koha::Holds->search({'found' => 'W'}, { columns => [ 'itemnumber' ], collapse => 1 }); -- 2.39.5