Hacker Newsnew | past | comments | ask | show | jobs | submitlogin



Good, because that would be really pathetic to not perform the simplest dead code elimination.


Only for MyISAM tables...its a different story with Innodb: http://www.mysqlperformanceblog.com/2006/12/01/count-for-inn...


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( * )).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: