Just fetch the rows one at a time, up to your limit, then use $sth->finish to tell DBI you're done. On the databases for which it works, it does the job. On databases for which it doesn't (the whole query comes back regardless), you haven't lost anything.