Added optimize of cid_channels_recent_ tables to flush-DB script

git-svn-id: svn://192.168.202.10@3049 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2018-10-04 01:17:35 +00:00
parent 2e75aa39e7
commit a54a7cd489
+14
View File
@@ -25,6 +25,7 @@
# 180112-0915 - Added flush for cid_channels_recent table
# 180511-1223 - Added flush for server-specific cid_channels_recent_ tables
# 180519-1431 - Added vicidial_inbound_groups optimization
# 181003-2115 - Added optimize of cid_channels_recent_ tables
#
### begin parsing run-time options ###
@@ -408,6 +409,19 @@ while ($sthArows > $aas)
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) { $affected_rows = $dbhA->do($stmtA);}
if (!$Q) {print " - cid_channels_recent_$PADserver_ip[$aas] flush: $affected_rows rows\n";}
$stmtA = "OPTIMIZE table cid_channels_recent_$PADserver_ip[$aas];";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
if (!$Q) {print " - OPTIMIZE cid_channels_recent_$PADserver_ip[$aas] \n";}
}
$aas++;
}