Timeline for SQL & PHP - Which is faster mysql_num_rows() or 'select count()'?
Current License: CC BY-SA 2.5
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 21, 2010 at 0:07 | comment | added | VolkerK |
And the * in Count(*) means "Don't look at the data, just count the records" as opposed to Count(colname).
|
|
Mar 21, 2010 at 0:00 | comment | added | Michael Borgwardt | Your guess could backfire - COUNT(*) is the idiomatic way of getting the size of a result set, and any database worth its salt will be optimized for it. | |
Mar 21, 2010 at 0:00 | comment | added | dev-null-dweller |
If storage engine is MyISAM and there are no WHERE conditions, count(*) will be faster, because exact record count is stored for MyISAM tables.
|
|
Mar 20, 2010 at 23:53 | history | edited | Li0liQ | CC BY-SA 2.5 |
added 361 characters in body; added 82 characters in body; added 24 characters in body
|
Mar 20, 2010 at 23:47 | history | answered | Li0liQ | CC BY-SA 2.5 |