summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-04-25 13:37:11 -0700
committerIvan Kohler <ivan@freeside.biz>2017-04-25 13:37:11 -0700
commitf9080ff94784f66cca0e94458a98d87af262474d (patch)
treebbab0840d036d8259feed52d110c63f85b646360
parenta33bb156250931929f9f96f7a0cc60bc9e149d22 (diff)
fix occasional bad query planning searching for CDRs, RT#74494
-rw-r--r--FS/FS/svc_phone.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm
index 0c42832ff..ccc28a0df 100644
--- a/FS/FS/svc_phone.pm
+++ b/FS/FS/svc_phone.pm
@@ -852,8 +852,15 @@ the entire result set.
=cut
sub psearch_cdrs {
-
my($self, %options) = @_;
+
+ unless ( $options{'billsec_sum'} ) {
+ #fixes a weird sequential scan of the whole cdr table on startdate, but only
+ # for a few charged_party values here and there.
+ # Pg 9.1 only? need to retest on 9.4, 9.6
+ dbh->do('SET enable_indexscan TO OFF');
+ }
+
my @fields;
my %hash;
my @where;