Iam使用MySQL运行我的Rails应用程序。我开始审查我的MySQL慢速查询日志,我看到大约有6000行主要重复以下查询。MySQL - 提高查询性能
SET timestamp=1488423689;
SELECT COUNT(*) FROM `system_events`
WHERE (notified
AND id != 476200
AND customer_id = 1
AND classification = 50039
AND created_at >= '2017-02-27 03:01:26');
# Time: 170302 3:01:49
# Thread_id: 2972915 Schema: ash#### Last_errno: 0 Killed: 0
# Query_time: 7.195183 Lock_time: 0.000029 Rows_sent: 1 Rows_examined: 26296 Rows_affected: 0 Rows_read: 26296
# Bytes_sent: 63
系统事件表
系统活动说明:
是否SELECT COUNT(*)有性能问题?如何解决它们?