Jump to content

Total number of rows?


jokerfool

Recommended Posts

  Quote

If you want the number of rows in a table use "SELECT COUNT(*) FROM tablename". Mysql does not have to read every row to get this value as it would if you were to use mysql_num_rows().

Only true for certain storage engines which store row_count in the table's metadata.  IIRC, it works instantly on MyISAM, but slower on InnoDB.

 

But the OP was asking for number of comments per topic anyway, I think.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.