From: Bill Erickson Date: Mon, 22 May 2017 18:21:05 +0000 (-0400) Subject: JBAS-826 Record hold counts for bib-level only X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a7ba493048497d4ba4dde193b8704d877d25a994;p=working%2FEvergreen.git JBAS-826 Record hold counts for bib-level only Modify the holds-per-record counting code to only look at title-level holds, for now anyway. This is makes the query a lot faster, which is a concern given that we still see several million API calls to open-ils.circ.bre.holds.count per day. Signed-off-by: Bill Erickson --- 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 2cb5cb94be..2493890fd6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -4306,47 +4306,51 @@ sub rec_hold_count { '+ahr' => { cancel_time => undef, fulfillment_time => undef, - '-or' => [ - { - '-and' => { - hold_type => [qw/C F R/], - target => { - in => { - select => {acp => ['id']}, - from => { acp => $cn_join } - } - } - } - }, - { - '-and' => { - hold_type => 'V', - target => { - in => { - select => {acn => ['id']}, - from => {acn => $bre_join} - } - } - } - }, - { - '-and' => { - hold_type => 'P', - target => { - in => { - select => {bmp => ['id']}, - from => {bmp => $bre_join} - } - } - } - }, - { - '-and' => { - hold_type => 'T', - target => $target_id - } - } - ] +# KCLS JBAS-826 -- make the record hold counts query faster by only +# counting bib-level holds (which represent >99% of KCLS' holds). + hold_type => 'T', + target => $target_id +# '-or' => [ +# { +# '-and' => { +# hold_type => [qw/C F R/], +# target => { +# in => { +# select => {acp => ['id']}, +# from => { acp => $cn_join } +# } +# } +# } +# }, +# { +# '-and' => { +# hold_type => 'V', +# target => { +# in => { +# select => {acn => ['id']}, +# from => {acn => $bre_join} +# } +# } +# } +# }, +# { +# '-and' => { +# hold_type => 'P', +# target => { +# in => { +# select => {bmp => ['id']}, +# from => {bmp => $bre_join} +# } +# } +# } +# }, +# { +# '-and' => { +# hold_type => 'T', +# target => $target_id +# } +# } +# ] } } };