my $sth = $dbh->prepare("select * from campaigns where mw_export='yes' and last_update > ?"); $sth->execute(last_transfer{'campaigns'}); while(my $result = $sth->fetchrow_hashref()) { print "It takes me over 30 minutes to print this!!!\n"; } #### alter table campaigns add index mw_export (mw_export); alter table campaigns add index last_update (last_update);