in reply to bind_columns OR fetchall_arrayref

Have a look at: Speeding up the DBI, it contains valuable information about DBI, and about what methods to use.
example from this page (since you want to query large amounts of data):
$sth->execute; # dataset has 1,000,000 records # # DON'T DO THIS # my $aref = $sth->fetchall_arrayref; # # It would create a 1,000,000 rows array my $max_rows = 5_000; while (my $aref = $sth->fetchall_arrayref(undef, $max_rows)) { # do something with $aref # $aref now contains (at most) 5,000 rows };