Subject: | performance-problem (IMPORT-Feature) |
Performance problem with the IMPORT-Feature.
The attached patch solves this.
(using prepare and execute instead of do... improves performance more
than 100%)
Subject: | SQL-Statement.pm.patch |
diff -r -u SQL-Statement-1.27.old/lib/SQL/Statement.pm SQL-Statement-1.27/lib/SQL/Statement.pm
--- SQL-Statement-1.27.old/lib/SQL/Statement.pm 2010-05-06 18:08:13.000000000 +0200
+++ SQL-Statement-1.27/lib/SQL/Statement.pm 2010-05-09 18:03:29.000000000 +0200
@@ -186,7 +186,8 @@
$data->{Database}->do($create_sql);
my $colstr = ('?,') x @tbl_cols;
my $insert_sql = "INSERT INTO $tbl_name VALUES($colstr)";
- $data->{Database}->do( $insert_sql, {}, @$_ ) for @$tbl_data;
+ my $local_sth=$data->{Database}->prepare( $insert_sql );
+ $local_sth->execute( @$_ ) for @$tbl_data;
return ( 0, 0 );
}
my ( $eval, $foo ) = $self->open_tables( $data, 1, 1 );