我的托管人声称以下 SQL 查询使服务器超载并导致其执行缓慢并威胁要禁用我的帐户。我似乎找不到瓶颈 - 任何人都可以帮我检测这一切的来源吗?
1 分钟前在数据库 --> mydb_name 上执行 8 秒。
SELECT * FROM tsk_posts
LEFT JOIN tsk_term_relationships ON
(tsk_posts.ID = tsk_term_relationships.object_id)
LEFT JOIN tsk_term_taxonomy ON
(tsk_term_relationships.term_taxonomy_id = tsk_term_taxonomy.term_taxonomy_id)
WHERE
tsk_posts.post_status = 'publish'
AND
tsk_posts.post_type = 'post'
AND
tsk_term_taxonomy.taxonomy = 'category'
AND
( tsk_term_taxonomy.term_id = 4 OR tsk_term_taxonomy.term_id = 103 OR
tsk_term_taxonomy.term_id = 19 OR tsk_term_taxonomy.term_id = 20 OR
tsk_term_taxonomy.term_id = 5 OR tsk_term_taxonomy.term_id = 2 OR
tsk_term_taxonomy.term_id = 14 )
ORDER BY RAND()
LIMIT 1
非常感谢。