- Code: Select all
SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list where ... and (last_local_call_time < "2014-11-04 12:16:33") ) or ( (gmt_offset_now='-3.00') and (last_local_call_time < "2014-11-04 12:01:33") ) or ( (gmt_offset_now='-3.25') and (last_local_call_time < "2014-11-04 11:46:33") ) or ( (gmt_offset_now='-3.50') and (last_local_call_time < "2014-11-04 11:31:33") ) or ( (gmt_offset_now='-3.75') and (last_local_call_time < "2014-11-04 11:16:33") ) or ( (gmt_offset_now='-4.00') and (last_local_call_time < "2014-11-04 11:01:33") ) or ( (gmt_offset_now='-4.25') and (last_local_call_time < "2014-11-04 10:46:33") ) or ( (gmt_offset_now='-4.50') and (last_local_call_time < "2014-11-04 10:31:33") ) or ( (gmt_offset_now='-4.75') and (last_local_call_time < "2014-11-04 10:16:33") ) or ( (gmt_offset_now='-5.00') and (last_local_call_time < "2014-11-04 10:01:33") ) or ( (gmt_offset_now='-5.25') and (last_local_call_time < "2014-11-04 09:46:33") ) or ( (gmt_offset_now='-5.50') and (last_local_call_time < "2014-11-04 09:31:33") ) or ( (gmt_offset_now='-5.75') and ...,'15244847','15244772','15244755','15242997','15242941','0') and ((gmt_offset_now IN('13.00','1.75','1.50','1.25','1.00','0.75','0.50','0.25','0.00','-0.25','-0.50','-0.75','-1.00','-1.25','-1.50','-1.75','-2.00','-2.25','-2.50','-2.75','-3.00','-3.25','-3.50','-3.75','-4.00','-4.25','-4.50','-4.75','-5.00','-5.25','-5.50','-5.75','-6.00','-6.25','-6.50','-6.75','-7.00','-7.25','-7.50','-7.75','-8.00','-8.25','-8.50','-8.75','-9.00','-9.25','-9.50','-9.75','-10.00','-10.25','-10.50','-10.75','-11.00','99') ) ) and ( phone_number not in (select phone_number from asterisk.vicidial_dnc) ) and (called_count < 7) order by lead_id asc limit 500;
Aside from the fact that this query is huge and devours resources when it runs, there are no active campaigns that have any sort of last call time sorting, up or down. I have changed the campaigns to use "Down" for the list order and the above query is running. however when i change the campaigns to actually use down last call count, the DB doesn't lockup.
I was changing this setting to help reduce server load. I cant dump the vicidial_list table. Thanks for any suggestion