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(*)有性能問題?如何解決它們?