- COUNT (*) is typically an index scan of a primary key, and Count (column) does not necessarily
- COUNT (*) is the total number of records in the statistics table, count (column) is the number of records for all eligible columns in the tables
- Count, if there is no where limit, MySQL directly return to save the total number of records, and there is a where limit, always to the MySQL full table traversal
- If the column in Count (column) is a primary key, Count (column) is faster than COUNT (*), otherwise, COUNT (*) is fast
- In any case, select COUNT (*) from table is the best choice
- Minimize select COUNT (*) from table where column = ' value ' such a query
- Eliminate the appearance of select Count (column) from table
- The offset of the column determines the performance, the higher the column, the greater the cost of access, the count (*) algorithm and the offset, so count (*) the fastest, count (the last column) slowest
MySQL Count (*) and Count (column) rate