'+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
+# }
+# }
+# ]
}
}
};