News for hackers. Stuff that matters.
Re:MySQL and partitioning tables with millions of rows by rimantas on Sunday January 31, 2010 @04:51PM (#1091166)
MySQL does not scan any rows for SELECT COUNT(*) FROM table — the number of records is stored in table metadata. (Mind you, it only works for this kind of query, as soon as you add WHERE the story changes). On the other hand, MyISAM only has table level locks, not row level. I guess it is time for you to analyze what your app does with DB and how it can affect locking…
Re:MySQL and partitioning tables with millions of rows by jfarmer on Sunday January 31, 2010 @04:53PM (#1091171)
Sort of true -- for the InnoDB engine SELECT COUNT(*) FROM table is more complicated because each transaction has its own view of the table. So unlike MyISAM (which uses one big table-level lock to guarantee consistency), it can't store a row count on a per-table basis.