我正在尝试优化此查询以使其更有效并停止加载缓慢。有人可以告诉我我需要做些什么来优化这个以供将来参考。
SELECT * , username AS user,
(SELECT COUNT(*) FROM pvp WHERE killer = user) AS kills,
(SELECT COUNT(*) FROM pvp WHERE username = user) AS deaths,
ROUND(kills / deaths, 2) AS kd FROM stats WHERE username = "Username"