どのテーブルと列にインデックスを付ける必要がありますか?flow_permanent_idとentry_idにインデックスがありますが、filesortを使用しているようです。
これを最適化するにはどうすればよいですか?
mysql> explain SELECT COUNT(*) AS count_all, entry_id AS entry_id FROM `votes` WHERE `votes`.`flow_permanent_id` = '4fab490cdc1c82cfa800000a' GROUP BY entry_id;
+----+-------------+-------+------+----------------------------------+----------------------------------+---------+-------+------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+----------------------------------+----------------------------------+---------+-------+------+----------------------------------------------+
| 1 | SIMPLE | votes | ref | index_votes_on_flow_permanent_id | index_votes_on_flow_permanent_id | 74 | const | 1 | Using where; Using temporary; Using filesort |
+----+-------------+-------+------+----------------------------------+----------------------------------+---------+-------+------+----------------------------------------------+
1 row in set (0.00 sec)