in reply to Theres no LIMIT

I'd keep it as you use above. Typically, a lot of time is spent in DBI calls in the process of translating the data from the database's format to the internal structure used by perl's DBI. If, to just figure the size of the data, you used a "SELECT *" SQL call, you'd have to wait for the system to put the entire database into perl memory before you get that value. Unless the database was rather small , splitting your SQL up into these two separate pieces will be faster (since you only have to convert 10 rows + 1 data piece) than converting N rows altogether.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important