Query Locking the vicidial_log table
Posted: Fri Jan 27, 2023 1:14 pm
We have a new query we see locking the vicidial_log table and causing issues.
We have a slave database and have all the reports using it, I am thinking its some automation that checks hourly stats or something but it seems to have just started happening.
I also have been using the archive log script with days=1 to keep the log table as small as possible but its still locking.
Does anyone know whats running this query and why?
SVN 3594
SELECT CONCAT(substr(call_date, 1, 13), ':00:00') as hour_int, count(*), CONCAT(substr(call_date+INTERVAL 1 HOUR, 1, 13), ':00:00') as next_hour from vicidial_log FORCE INDEX (call_date) where campaign_id='CAMPAIGN1' and call_date >= '2023-01-27 09:00:00' and status IN('DROP','XDROP','CALLBK','CBHOLD','DEC','DNC','SALE','NI','NP','XFER','RQXFER','TIMEOT','AFTHRS','NANQUE','PDROP','IVRXFR','SVYCLM','MLINAT','MAXCAL','LRERR','QCFAIL','WN','TEST','CBL','DNCR','DA','FR','OptOUT','UTCB') and user != 'VDAD' group by hour_int, next_hour order by hour_int
and also
SELECT count(*) from vicidial_log FORCE INDEX (call_date) where campaign_id='CAMPAIGN1' and call_date > '2023-01-27 9:9:37' and status IN('DROP','XDROP','CALLBK','CBHOLD','DEC','DNC','SALE','NI','NP','XFER','RQXFER','TIMEOT','AFTHRS','NANQUE','PDROP','IVRXFR','SVYCLM','MLINAT','MAXCAL','LRERR','QCFAIL','WN','TEST','CBL','DNCR','DA','FR')
Thank you!
We have a slave database and have all the reports using it, I am thinking its some automation that checks hourly stats or something but it seems to have just started happening.
I also have been using the archive log script with days=1 to keep the log table as small as possible but its still locking.
Does anyone know whats running this query and why?
SVN 3594
SELECT CONCAT(substr(call_date, 1, 13), ':00:00') as hour_int, count(*), CONCAT(substr(call_date+INTERVAL 1 HOUR, 1, 13), ':00:00') as next_hour from vicidial_log FORCE INDEX (call_date) where campaign_id='CAMPAIGN1' and call_date >= '2023-01-27 09:00:00' and status IN('DROP','XDROP','CALLBK','CBHOLD','DEC','DNC','SALE','NI','NP','XFER','RQXFER','TIMEOT','AFTHRS','NANQUE','PDROP','IVRXFR','SVYCLM','MLINAT','MAXCAL','LRERR','QCFAIL','WN','TEST','CBL','DNCR','DA','FR','OptOUT','UTCB') and user != 'VDAD' group by hour_int, next_hour order by hour_int
and also
SELECT count(*) from vicidial_log FORCE INDEX (call_date) where campaign_id='CAMPAIGN1' and call_date > '2023-01-27 9:9:37' and status IN('DROP','XDROP','CALLBK','CBHOLD','DEC','DNC','SALE','NI','NP','XFER','RQXFER','TIMEOT','AFTHRS','NANQUE','PDROP','IVRXFR','SVYCLM','MLINAT','MAXCAL','LRERR','QCFAIL','WN','TEST','CBL','DNCR','DA','FR')
Thank you!