added database optimizations
added uniqueid to vicidial_closer_log beta start of IVRstats report git-svn-id: svn://192.168.202.10@991 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -653,7 +653,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
|
||||
{
|
||||
$VHqueryCID = "VA$CIDdate$hour$min$sec$sec";
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_closer_log set status='DROP',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id = '$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='AFTER HOURS DROP',term_reason='AFTERHOURS';";
|
||||
$stmtA = "INSERT INTO vicidial_closer_log set status='DROP',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id = '$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='AFTER HOURS DROP',term_reason='AFTERHOURS',uniqueid='$uniqueid';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
|
||||
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
|
||||
@@ -886,7 +886,7 @@ if ($Uaffected_rows < 1)
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
}
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_closer_log (lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,xfercallid) values('$insert_lead_id','$channel_group','$SQLdate','$now_date_epoch','QUEUE','$phone_code','$phone_number','VDCL','N','$insert_xfer_id')";
|
||||
$stmtA = "INSERT INTO vicidial_closer_log (lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,xfercallid,uniqueid) values('$insert_lead_id','$channel_group','$SQLdate','$now_date_epoch','QUEUE','$phone_code','$phone_number','VDCL','N','$insert_xfer_id','$uniqueid')";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
|
||||
|
||||
@@ -392,9 +392,11 @@ queue_seconds DECIMAL(7,2) default '0',
|
||||
user_group VARCHAR(20),
|
||||
xfercallid INT(9) UNSIGNED,
|
||||
term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE',
|
||||
uniqueid VARCHAR(20) NOT NULL default '',
|
||||
index (lead_id),
|
||||
index (call_date),
|
||||
index (campaign_id)
|
||||
index (campaign_id),
|
||||
index (uniqueid)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_xfer_log (
|
||||
@@ -1325,7 +1327,24 @@ INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_of
|
||||
|
||||
UPDATE system_settings SET qc_last_pull_time=NOW();
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1111';
|
||||
CREATE INDEX country_postal_code on vicidial_postal_codes (country_code,postal_code);
|
||||
CREATE INDEX country_area_code on vicidial_phone_codes (country_code,areacode);
|
||||
CREATE INDEX country_state on vicidial_phone_codes (country_code,state);
|
||||
CREATE INDEX country_code on vicidial_phone_codes (country_code);
|
||||
CREATE INDEX phone_list on vicidial_list (phone_number,list_id);
|
||||
CREATE INDEX list_phone on vicidial_list (list_id,phone_number);
|
||||
CREATE INDEX start_time on call_log (start_time);
|
||||
CREATE INDEX end_time on call_log (end_time);
|
||||
CREATE INDEX time on call_log (start_time,end_time);
|
||||
CREATE INDEX list_status on vicidial_list (list_id,status);
|
||||
CREATE INDEX time_user on vicidial_agent_log (event_time,user);
|
||||
CREATE INDEX date_user on vicidial_xfer_log (call_date,user);
|
||||
CREATE INDEX date_closer on vicidial_xfer_log (call_date,closer);
|
||||
CREATE INDEX phone_number on vicidial_xfer_log (phone_number);
|
||||
CREATE INDEX phone_number on vicidial_closer_log (phone_number);
|
||||
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1113';
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -489,3 +489,28 @@ UPDATE system_settings SET db_schema_version='1110';
|
||||
CREATE UNIQUE INDEX server_id on servers (server_id);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1111';
|
||||
|
||||
ALTER TABLE vicidial_closer_log ADD uniqueid VARCHAR(20) NOT NULL default '';
|
||||
|
||||
CREATE INDEX uniqueid on vicidial_closer_log (uniqueid);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1112';
|
||||
|
||||
CREATE INDEX country_postal_code on vicidial_postal_codes (country_code,postal_code);
|
||||
CREATE INDEX country_area_code on vicidial_phone_codes (country_code,areacode);
|
||||
CREATE INDEX country_state on vicidial_phone_codes (country_code,state);
|
||||
CREATE INDEX country_code on vicidial_phone_codes (country_code);
|
||||
CREATE INDEX phone_list on vicidial_list (phone_number,list_id);
|
||||
CREATE INDEX list_phone on vicidial_list (list_id,phone_number);
|
||||
CREATE INDEX start_time on call_log (start_time);
|
||||
CREATE INDEX end_time on call_log (end_time);
|
||||
CREATE INDEX time on call_log (start_time,end_time);
|
||||
CREATE INDEX list_status on vicidial_list (list_id,status);
|
||||
CREATE INDEX time_user on vicidial_agent_log (event_time,user);
|
||||
CREATE INDEX date_user on vicidial_xfer_log (call_date,user);
|
||||
CREATE INDEX date_closer on vicidial_xfer_log (call_date,closer);
|
||||
CREATE INDEX phone_number on vicidial_xfer_log (phone_number);
|
||||
CREATE INDEX phone_number on vicidial_closer_log (phone_number);
|
||||
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1113';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user