MySQL试图优化查询

时间:2014-01-17 03:50:09

标签: php mysql sql

我正在尝试优化此查询以使其更有效并停止加载缓慢。有人可以告诉我我需要做些什么来优化这个以供将来参考。

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"

0 个答案:

没有答案