From 71fa0b99c71507a3ae8ac163d177b64b66d694ad Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Wed, 16 Sep 2015 13:02:06 -0700 Subject: [PATCH] LP#1499086: Speed up bookbag retrieval This speeds up retrieval of large bookbags by making acn the core class in basic_opac_copy_query This is a modified version of some changes suggested by Mike Rylander. Signed-off-by: Jeff Davis Conflicts: Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm Signed-off-by: Galen Charlton --- .../perlmods/lib/OpenILS/Application/AppUtils.pm | 77 +++++++++++----------- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 2 +- 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index 1378a471ba..77a81e38b9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -2033,55 +2033,54 @@ sub basic_opac_copy_query { }, from => { - acp => { - ($iss_id ? ( - sitem => { - fkey => 'id', - field => 'unit', - filter => {issuance => $iss_id}, - join => { - sstr => { } + acn => { + acnp => { fkey => 'prefix' }, + acns => { fkey => 'suffix' }, + acp => { + fkey => 'id', + field => 'call_number', + join => { + ($iss_id ? ( + sitem => { + fkey => 'id', + field => 'unit', + filter => {issuance => $iss_id}, + join => { + sstr => { } + } } - } - ) : ()), - acn => { - join => { - acnp => { fkey => 'prefix' }, - acns => { fkey => 'suffix' } + ) : ()), + circ => { # If the copy is circulating, retrieve the open circ + type => 'left', + filter => {checkin_time => undef} + }, + acpl => { + filter => { + deleted => 'f', + ($staff ? () : ( opac_visible => 't' )), + }, }, - filter => [ - {deleted => 'f'}, - ($rec_id ? {record => $rec_id} : ()) - ], - }, - circ => { # If the copy is circulating, retrieve the open circ - type => 'left', - filter => {checkin_time => undef} - }, - acpl => { - filter => { - deleted => 'f', - ($staff ? () : ( opac_visible => 't' )), + ccs => { + ($staff ? () : (filter => { opac_visible => 't' })) }, - }, - ccs => { - ($staff ? () : (filter => { opac_visible => 't' })) - }, - aou => {}, - acpm => { - type => 'left', - join => { - bmp => { type => 'left', filter => { deleted => 'f' } } + aou => {}, + acpm => { + type => 'left', + join => { + bmp => { type => 'left', filter => { deleted => 'f' } } + } } + } } } }, where => { - '+acp' => { - deleted => 'f', + '+acp' => { + deleted => 'f', ($staff ? () : (opac_visible => 't')) - }, + }, + ($rec_id ? (record => $rec_id) : ()), ($dist_id ? ( '+sstr' => { distribution => $dist_id } ) : ()), ($staff ? () : ( '+aou' => { opac_visible => 't' } )) }, diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm index 418f8841bd..3c7e9dfdf7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -245,7 +245,7 @@ sub mk_copy_query { if($org != $self->ctx->{aou_tree}->()->id) { # no need to add the org join filter if we're not actually filtering - $query->{from}->{acp}->{aou} = { + $query->{from}->{acn}->{acp}->{join}->{aou} = { fkey => 'circ_lib', field => 'id', filter => { -- 2.11.0