我有一个 mysql 表,最多有 2.000.000 条记录
怎样才能在最快的时间内计算出表中的行数?
最佳答案
有关所有存储引擎的准确计数:
select count(*) from table1;
为了更快的 MyISAM 精确计数或 InnoDB 估计计数:
show table status;
或
select table_schema, table_name, table_rows from information_schema where table_name = 'table1' and table_schema = 'schema1';
关于mysql - 计算mysql中表的行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25571470/