提高查询速度!!! 郁闷死了!! 新手!!! 求救!!
核心:如何提高一个10万行的   商家的AVG()的评分的排序?   
 有10万个商家   ,每个商家有多人打分,大概有100万个分数,平均每个商家10个分数,现在是统计出10万个商家的每一个的平均分,然后根据每个商家的平均分从大到小排序?      怎么提高速度啊?      搞了很久,没人回答我啊???救命!!   
 现在是另外建立了一个视图,视图里面放了10万个商家,还有一个字段是每个商家的平均分。      然后根据视图的这个字段   desc   排序。很慢!!!!     
 http://www.yyhou.com/Shop/Shops.aspx?BType=2   
 这个页面   本来是要按   星级   倒序排列的   ,但是很慢,超时就没有放上去, 
 搞得现在是按   点击数   倒叙排列,而且还不算快!           
 但是   搜索页面   按   星级   倒序排列却快很多,为什么啊? 
 http://www.yyhou.com/SearchShops.aspx?Search=1&City=1     
 附录存储过程: 
 CREATE   procedure   GetShopsByCity    
 (@Type   TinyInt, 
 @CityId   SmallInt, 
 @pagesize   int, 
 @pageindex   int) 
 as 
 set   nocount   on     
 begin 
 declare   @indextable   table(id   int   identity(1,1),nid   int) 
 declare   @PageLowerBound   int 
 declare   @PageUpperBound   int 
 set   @PageLowerBound=(@pageindex-1)*@pagesize 
 set   @PageUpperBound=@PageLowerBound+@pagesize 
 set   rowcount   @PageUpperBound 
 insert   into   @indextable(nid)   select   Id   from   ShopsList      where   type=@type   and   city=@cityid   order   by   Rate   desc 
                      select   O.Id,O.[Name],O.Phone,O.Address,O.CommentNumber,O.ClickTimes,O.RecentId,O.RecentHead,O.RecentContent, 
                                                       case    
                                           when   Rate> =1   and   Rate <1.25   then    '1 ' 
                                           when   Rate> =1.25   and   Rate <1.75   then    '1.5 ' 
                                           when   Rate> =1.75   and   Rate <2.25   then    '2 ' 
                                           when   Rate> =2.25   and   Rate <2.75   then    '2.5 ' 
                                           when   Rate> =2.75   and   Rate <3.25   then    '3 ' 
                                           when   Rate> =3.25   and   Rate <3.75   then    '3.5 ' 
                                           when   Rate> =3.75   and   Rate <4.25   then    '4 ' 
                                           when   Rate> =4.25   and   Rate <4.75   then    '4.5 ' 
                                           when   Rate> =4.75   and   Rate <=5   then    '5 ' 
                                           end   as   Rate