其他分享
首页 > 其他分享> > InnoDB handles SELECT COUNT(*) and SELECT COUNT(1) operations in the same way. There is no performan

InnoDB handles SELECT COUNT(*) and SELECT COUNT(1) operations in the same way. There is no performan

作者:互联网

MySQL :: MySQL 8.0 Reference Manual :: 12.20.1 Aggregate Function Descriptions https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_count

 

MySQL :: MySQL 8.0 Reference Manual :: 3.3.4.8 Counting Rows https://dev.mysql.com/doc/refman/8.0/en/counting-rows.html

MySQL :: MySQL 8.0 Reference Manual :: 13.7.7.38 SHOW TABLE STATUS Statement https://dev.mysql.com/doc/refman/8.0/en/show-table-status.html

Rows

The number of rows. Some storage engines, such as MyISAM, store the exact count. For other storage engines, such as InnoDB, this value is an approximation, and may vary from the actual value by as much as 40% to 50%. In such cases, use SELECT COUNT(*) to obtain an accurate count.

The Rows value is NULL for INFORMATION_SCHEMA tables.

For InnoDB tables, the row count is only a rough estimate used in SQL optimization. (This is also true if the InnoDB table is partitioned.)

 

标签:COUNT,operations,rows,count,InnoDB,student,SELECT
来源: https://www.cnblogs.com/rsapaper/p/16527204.html