News for hackers. Stuff that matters.
Re:See Twitter's SQL. by amarcus on Monday July 07, 2008 @12:39AM (#238322)
Only for MyISAM tables...its a different story with Innodb: http://www.mysqlperformanceblog.com/2006/12/01/count-for-inn...
Re:See Twitter's SQL. by neilc on Monday July 07, 2008 @01:57AM (#238364)
Not AFAICS; count( * ) and count( 1 ) are trivially equivalent, and this doesn't depend on the storage engine being used. It is true that count( * ) without a WHERE clause is much faster in MyISAM than in Innodb (or Postgres), but that is a different optimization (count( * ) => metadata lookup, not count( 1 ) => count( * )).