50000条数据检索,这个SQL文慢的离谱,还能优化提速吗?各位达人帮看看!
SELECT Result1.BV_Phase, Result2.BV_Count FROM
(
SELECT T_BV_Phase AS BV_Phase FROM T_Vote GROUP BY T_BV_Phase
)
AS Result1
LEFT JOIN
(
SELECT COUNT(*)AS BV_Count,T_BV_Phase AS BV_Phase FROM T_Vote
WHERE T_BV_FoundDay<#2004/11/18# AND T_BV_FoundDay<>NULL
GROUP BY T_BV_Phase
)
AS Result2
ON
(
Result1.BV_Phase = Result2.BV_Phase
)
OR
(
Result1.BV_Phase IS NULL AND Result2.BV_Phase IS NULL
)