MySQL - Complexity of: SELECT COUNT(*) FROM MyTable;

前端 未结 3 1676
感动是毒
感动是毒 2020-12-06 17:50

What is the complexity of this MySQL query

SELECT COUNT(*) FROM MyTable;

Is the count of number of entries in a table stored somewhere and

3条回答
  •  旧时难觅i
    2020-12-06 18:06

    AFAIK in MyISAM rows-count are cached, in InnoDB not, and with every count-all he counts all rows.

提交回复
热议问题