speeding a lot rebuild_nozebra by using autocommit OFF feature
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
b0d18cfd4d
commit
bcf36122a6
|
|
@ -165,6 +165,10 @@ while (my ($biblionumber) = $sth->fetchrow) {
|
|||
}
|
||||
print "\nInserting records...\n";
|
||||
$i=0;
|
||||
|
||||
my $commitnum = 100;
|
||||
$dbh->{AutoCommit} = 0;
|
||||
|
||||
$sth = $dbh->prepare("INSERT INTO nozebra (server,indexname,value,biblionumbers) VALUES ('biblioserver',?,?,?)");
|
||||
foreach my $key (keys %result) {
|
||||
foreach my $index (keys %{$result{$key}}) {
|
||||
|
|
@ -174,6 +178,7 @@ foreach my $key (keys %result) {
|
|||
print "\r$i";
|
||||
$i++;
|
||||
$sth->execute($key,$index,$result{$key}->{$index});
|
||||
$dbh->commit() if (0 == $i % $commitnum);
|
||||
}
|
||||
}
|
||||
print "\nbiblios done\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue