Skip Menu |

This queue is for tickets about the SQL-Statement CPAN distribution.

Report information
The Basics
Id: 57322
Status: resolved
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: sven.probst [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.27
Fixed in: (no value)



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 );
Applied to trunk repository. Thank you very much. If you're using the IMPORT feature, could you provide a test which proves importing from a DBD::DBM database into a DBD::CSV database? Jens
Released with SQL::Statement 1.28