目前,我用下面的问询进行 j。 在可能的情况下,你不知道jsPerf,有两个表格:pages
。 载有测试案例/修订和<代码>测试,其中载有测试案件中测试所用的密码。
目前有937份记录载于<编码>网页,3817份记录载于tests/code>。
如您所见,在使用时使用该查询。
大约需要7秒才能执行:
SELECT
id AS pID,
slug AS url,
revision,
title,
published,
updated,
(
SELECT COUNT(*)
FROM pages
WHERE slug = url
AND visible = "y"
) AS revisionCount,
(
SELECT COUNT(*)
FROM tests
WHERE pageID = pID
) AS testCount
FROM pages
WHERE updated IN (
SELECT MAX(updated)
FROM pages
WHERE visible = "y"
GROUP BY slug
)
AND visible = "y"
ORDER BY updated DESC
I've Additional Index on all areas that listed in WHERE
clauses. 我是否应当增加?
如何优化这一询问?
P.S.,我知道,我可以实施PHP的套间系统——我很可能不会告诉我:)我真的希望找到如何改进这一询问。