From: Bill Erickson Date: Thu, 4 Aug 2011 19:01:09 +0000 (-0400) Subject: Speed up holds history retrieval X-Git-Tag: sprint4-merge-nov22~5128^2~71^2 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=39632c0346c1807eddee54c28675741668d1c264;p=working%2FEvergreen.git Speed up holds history retrieval Consistent w/ circ history retrieval, use the longer column 'transform' stored proc invocation to limit retrieval to historical holds IDs instead of entire objects, which are later fetched/fleshed anyway. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 26b1d524a1..9d3fab0844 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -755,15 +755,21 @@ sub load_myopac_hold_history { $ctx->{hold_history_limit} = $limit; $ctx->{hold_history_offset} = $offset; - - my $holds = $e->json_query({ - from => ['action.usr_visible_holds', $e->requestor->id], - limit => $limit || 25, - offset => $offset || 0 + my $hold_ids = $e->json_query({ + select => { + au => [{ + column => 'id', + transform => 'action.usr_visible_holds', + result_field => 'id' + }] + }, + from => 'au', + where => {id => $e->requestor->id}, + limit => $limit, + offset => $offset }); - $ctx->{holds} = $self->fetch_user_holds([map { $_->{id} } @$holds], 0, 1, 0, $limit, $offset); - + $ctx->{holds} = $self->fetch_user_holds([map { $_->{id} } @$hold_ids], 0, 1, 0); return Apache2::Const::OK; }