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

Hi
Better to use select count(*) from  table where <condition>
This is the fastest way possible. It will not overload your DB.
Thanks
Sasi Kumar

Replies are listed 'Best First'.
Re^2: Faster way of retrieving the number of recs in mysql
by Thilosophy (Curate) on Dec 13, 2004 at 09:23 UTC
    And unless necessary, omit the where clause. In MySQL, a count(*) can be answered just by querying the table meta data (VERY FAST), whereas conditions in the where clause will result in index or even table scans (ranging from NOT SO FAST to SLOW).
      In deed, thatīs a great solution! Itīs working just great now! Thanks a lot my friends!