[Koha-bugs] [Bug 24883] Command line utility to load yaml files
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Mar 19 14:55:48 CET 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24883
--- Comment #11 from Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> ---
(In reply to Jonathan Druart from comment #10)
> I tried to execute all the queries in a transaction (using txn_do), but no
> gain observed.
With this diff in my original script
diff --git a/misc/load_yaml.pl b/misc/load_yaml.pl
index e670f56660..8eed5ab933 100755
--- a/misc/load_yaml.pl
+++ b/misc/load_yaml.pl
@@ -63,7 +63,7 @@ eval {
if ($@){
die "Something went wrong loading file $file ($@)";
}
-
+$dbh->{'AutoCommit'} = 0;
for my $table ( @{ $yaml->{'tables'} } ) {
my $table_name = ( keys %$table )[0]; # table
name
my @rows = @{ $table->{$table_name}->{rows} }; #
@@ -86,3 +86,4 @@ for my $table ( @{ $yaml->{'tables'} } ) {
for my $statement ( @{ $yaml->{'sql_statements'} } ) { # extra
SQL statements
$dbh->do($statement);
}
+$dbh->{'AutoCommit'} = 1;
I see changes, form ~9s to ~1.3 for marc21_framework_DEFAULT.yml for example.
Of course I'm with you on putting the code in one place and other changes, just
want to share my results.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list