Optimization of count(*) in mysql 5.7

In MySQL 5.7, for the optimization of select count(*) from table, it can be
set as:
select count(*) from table where uid>0
where uid is the auxiliary index, the auxiliary index does not store data, but has a pointer to the corresponding , so it's faster;


but note the issue mentioned in http://www.ywnds.com/?p=10369, be careful

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326127067&siteId=291194637