Index: /trunk/doc/CHANGES.txt =================================================================== --- /trunk/doc/CHANGES.txt (リビジョン 57) +++ /trunk/doc/CHANGES.txt (リビジョン 58) @@ -3,4 +3,5 @@ 07.6.6 updatem2pfiletable.pl: +getxml2db.pl:  AutoCommitを使用せずに高速化をした。 Index: /trunk/install/perl/getxml2db.pl =================================================================== --- /trunk/install/perl/getxml2db.pl (リビジョン 21) +++ /trunk/install/perl/getxml2db.pl (リビジョン 58) @@ -52,4 +52,6 @@ $dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; + +$dbh->{AutoCommit} = 0; my ($content) = get("$uri"); @@ -127,6 +129,7 @@ $nomalstarttime = substr($sttime,8,4); $DBQuery = "insert into foltia_program values ($item{TID},$programtitle,'','$nomalstarttime','$length','','','3','1','')"; - $sth = $dbh->prepare($DBQuery); -$sth->execute(); +# $sth = $dbh->prepare($DBQuery); +# $sth->execute(); +$oserr = $dbh->do($DBQuery); &writelog("getxml2db ADD TV Progtam:$item{TID}:$programtitle"); @@ -143,6 +146,7 @@ if ($titlearray[0] ne "$programtitlename" ){ $DBQuery = "UPDATE foltia_program SET title = $programtitle where tid = '$item{TID}' "; - $sth = $dbh->prepare($DBQuery); - $sth->execute(); +# $sth = $dbh->prepare($DBQuery); +# $sth->execute(); + $oserr = $dbh->do($DBQuery); &writelog("getxml2db UPDATE TV Progtam:$item{TID}:$programtitle"); }#end if update @@ -184,7 +188,8 @@ WHERE tid = '$item{TID}' AND pid = '$item{PID}' "; } - $sth = $dbh->prepare($DBQuery); - $sth->execute(); - # @subtitledata= $sth->fetchrow_array; +# $sth = $dbh->prepare($DBQuery); +# $sth->execute(); + $oserr = $dbh->do($DBQuery); + }else{ #なければ追加 @@ -197,7 +202,8 @@ $DBQuery = "insert into foltia_subtitle values ( '$item{PID}','$item{TID}','$stationid','$item{Count}',$programSubTitle,'$recstartdate','$recenddate','$offsetmin' ,'$length')"; } - $sth = $dbh->prepare($DBQuery); - $sth->execute(); - # @subtitledata= $sth->fetchrow_array; +# $sth = $dbh->prepare($DBQuery); +# $sth->execute(); + $oserr = $dbh->do($DBQuery); + } @@ -211,4 +217,5 @@ }#foreach +$oserr = $dbh->commit; ## $dbh->disconnect();