Optimizing $dbh->do()
        ### Prepare the statement handle
        $sth = $dbh->prepare( “DELETE FROM megaliths WHERE id = ?” );
        ### Remove the first 100 rows one-by-one...
        $loopCounter = 0;
        while ( $loopCounter < 100 ) {
            $sth->execute( $loopCounter );
            $loopCounter++;
          }
        $sth->finish();
        ...
This is far faster than repeatedly preparing the same
statement over and over again
DBI: The Neophyte's Guide
61