in reply to Faster way of retrieving the number of recs in mysql

execute() starts a query, it doesn't necessarily _accomplish_ the query. (You may have been thinking of do() ) You must fetch the results.

If you are only interested in the count of rows or rows that would match, then perhaps you should use "select count(*) from table", and then use selectrow_array() to fetch the single value returned.

Explicitly asking for count(*) may allow some DBs to execute the request a lot faster than retrieving all that muck just to count.

  • Comment on Re: Faster way of retrieving the number of recs in mysql