最近做关键字排名,用下面的过程,当数据量到20万时候速度很慢,求高手帮忙优化,谢谢
最近做关键字排名,用下面的过程,当数据量到20万时候速度很慢,求高手帮忙优化,谢谢
Select * from A_Info as A
Inner Join B_Info As B On A.CorpID=B.CorpID
Where A.ParentID=0 and A.IsOpen=1 and A.IsAllow=1
and A.CorpID In (Select CorpID from B_Info where isAllow=1
and keyword=@Keyword and DateDiff(d,GetDate(),AddDate)<=ValidDay )
and A.AID In (Select Max(AID) from A_Info Group By CorpID)
Order By B.OrderRows Desc
效果如下
http://www.cn5135.com/Product/QueryResult.aspx?Keyword=%E6%89%8B%E6%9C%BA