3 ms·
I've always had select count(*) do a full table scan (or at least take considerable time) in innodb... Did something change?
by zht 8y ago
I've always had select count(*) do a full table scan (or at least take considerable time) in innodb... Did something change?
- evanelias 8y agoWithout a WHERE clause, select count(*) still does a full table scan (or full index scan) in InnoDB, and probably always will. It is optimized in MyISAM via table-level metadata, which is only possible because MyISAM doesn't use MVCC or support transactions. In InnoDB, you can get an estimated row count from SHOW TABLE STATUS, but the estimate is based on table stats and can be wildly inaccurate.