Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

DBD::SQLite bulk insert woes

by dwalin (Monk)
on Jun 18, 2011 at 12:11 UTC ( [id://910323]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    });
    
    $dbh->disconnect;
    
  2. or download this
    dwalin@sol:/tmp$ perl test.pl 100 1000 100
    Benchmark: timing 100 iterations of new, old...
           new: 22 wallclock secs (22.10 usr +  0.28 sys = 22.38 CPU) @  4
    +.47/s (n=100)
           old: 10 wallclock secs ( 9.87 usr +  0.08 sys =  9.95 CPU) @ 10
    +.05/s (n=100)
    
  3. or download this
    $sth->execute(@$_) for @batch;
     # spent  10.0ms making 10000 calls to DBI::st::execute, avg 1µs/call
    
  4. or download this
     $sth->execute_array({}, @newdata);
    # spent  3.17s making 10 calls to DBI::st::execute_array, avg 317ms/ca
    +ll
    # spent  3.17s making 10 calls to DBD::_::st::execute_array, avg 317ms
    +/call
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://910323]
Approved by derby
Front-paged by derby
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found