Google
      
发新话题
打印

如何优化一下oracle sql语句,加急!不胜感激

如何优化一下oracle sql语句,加急!不胜感激

如何优化一下oracle sql语句,加急!不胜感激


select     *
  from     (select   i.ID,i.Title,i.ChannelID,i.PublishTime,i.Admin,i.Remark
                    ,i.Reserved1,i.Reserved2,i.CityID,i.TempletID,i.Status,i.Keyword
                    ,i.FileAddress,i.IsPrivate,i.UserGroup,i.IP,i.IsOpen,i.CheckStatus
                    ,i.SubChannelID,i.Click,i.IsTop,i.UpdateTime,i.UserName,i.CityName
                    ,i.PublishTime as PutTime,c.Name,0,''
              from   P_Information i,P_Channel c
              where  i.SubChannelID=c.ID and i.ChannelID=1
            union all
            select   i.ID,i.Title,i.ChannelID,i.PublishTime,i.Admin,i.Remark
                    ,i.Reserved1,i.Reserved2,i.CityID,i.TempletID,i.Status,i.Keyword
                    ,i.FileAddress,i.IsPrivate,i.UserGroup,i.IP,i.IsOpen,i.CheckStatus
                    ,i.SubChannelID,i.Click,i.IsTop,i.UpdateTime,i.UserName,i.CityName
                    ,f.OPTime as PutTime,c.Name,f.SubChannelID,rc.Name
              from   P_Information i,P_InfoReference f,P_Channel c,P_Channel rc
              where  i.ID=f.InfoID and i.SubChannelID=c.ID and f.SubChannelID=rc.ID
                     and i.ID in (select  i.InfoID
                                    from  P_InfoReference i
                                    where 1=1 ) and f.id in(select   min(f.id)
                                                               from   P_Information i,P_InfoReference f  
                                                               where  i.ID=f.InfoID and f.SubChannelID=rc.ID
                                                                      and i.ID in (select  i.InfoID
                                                                                     from  P_InfoReference i
                                                                                   where 1=1 ))
            )
  order by PutTime DESC

TOP

帖一下执行计划

explain plan for
--你的SQL语句
/

@?/rdbms/admin/utlxplp



__________________

TOP

不知数据量,分部情况,又没有强约束情况.

基本上无法优化.

TOP

发新话题