How to speed up “select count(*)” with “group by” and “where”?

后端 未结 9 549
北恋
北恋 2020-12-07 10:28

How to speed up select count(*) with group by?
It\'s too slow and is used very frequently.
I have a big trouble using select count(*)

9条回答
  •  盖世英雄少女心
    2020-12-07 10:39

    You should keep a separate table of counts! This table could be updated on each insert / delete. It would make this sort of query instantaneous.

提交回复
热议问题