我正在将 testlink 用于我们的内部存储系统进行测试。以下查询耗时近 80 秒,并返回约 11k 行数据。有什么可以改进的地方吗?我假设瓶颈是两个左外连接。
现在的速度:
(11,002 total, Query took 82.8888 sec)
这是查询:
SELECT UA.build_id AS build_id,
UA.feature_id AS feature_id,
UA.user_id as user_id,
TPTCV.testplan_id AS testplan_id,
TPTCV.tcversion_id AS tcversion_id,
TPTCV.platform_id AS platform_id,
E.status AS status,
E.id as execution_id,
E.tester_id as tester_id
FROM user_assignments UA
LEFT OUTER JOIN testplan_tcversions TPTCV ON UA.feature_id = TPTCV.id
LEFT OUTER JOIN executions E ON TPTCV.tcversion_id = E.tcversion_id
AND UA.build_id = E.build_id
AND TPTCV.platform_id = E.platform_id
WHERE UA.type = 1 AND UA.build_id = 10
ORDER BY E.id DESC