From bcf36122a6c58c59627f5bfac2eab4e3e9e4ab5a Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 20 Feb 2008 06:55:13 +1300 Subject: [PATCH] speeding a lot rebuild_nozebra by using autocommit OFF feature Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- misc/migration_tools/rebuild_nozebra.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/migration_tools/rebuild_nozebra.pl b/misc/migration_tools/rebuild_nozebra.pl index 888c7ae9a9..a1191af9e6 100755 --- a/misc/migration_tools/rebuild_nozebra.pl +++ b/misc/migration_tools/rebuild_nozebra.pl @@ -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"; -- 2.39.5