1.group by optimization
Group by profession and count the number
select profession,count(*) from tb_user group by profession;
The performance of using temporary tables is relatively low.
Execute sql after creating the index
create index idx_user_pro_age_sta on tb_user(profession,age,status);
The performance analysis of the joint index that does not satisfy the leftmost prefix rule when grouping