[open-ils-commits] [GIT] Evergreen ILS branch master updated. 0c6580309531ec03ccf1a07b1e439e20289c475f

Evergreen Git git at git.evergreen-ils.org
Wed Jul 17 13:58:23 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  0c6580309531ec03ccf1a07b1e439e20289c475f (commit)
      from  55e62cb268e2435dfa052027229e635a243defd6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0c6580309531ec03ccf1a07b1e439e20289c475f
Author: Mike Rylander <mrylander at gmail.com>
Date:   Tue Jul 16 16:58:57 2013 -0400

    Optimize away always-true hold count clause
    
    When rendering results in the tpac we request hold counts for each record.
    Most of the time (that is, whenever org unit hiding is /not/ in use) we
    filter, essentially, on "where pickup_lib is in the org tree".  This is
    both useless and slow, so this commit will recognize that and optimize the
    test away.
    
    [LFW: fixed typo]
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index affbb2e..cb99b3d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -4133,6 +4133,11 @@ sub rec_hold_count {
 
 
     if (my $pld = $args->{pickup_lib_descendant}) {
+
+        my $top_ou = new_editor()->search_actor_org_unit(
+            {parent_ou => undef}
+        )->[0]; # XXX Assumes single root node. Not alone in this...
+
         $query->{where}->{'+ahr'}->{pickup_lib} = {
             in => {
                 select  => {aou => [{ 
@@ -4143,7 +4148,7 @@ sub rec_hold_count {
                 from    => 'aou',
                 where   => {id => $pld}
             }
-        };
+        } if ($pld != $top_ou->id);
     }
 
 

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list