日期:2014-05-17  浏览次数:20819 次

如何提高此语句的查询速度。?
select   '0 '   as   addcol,  
  a.id,a.title,a.mediumid,d.firstcont  
  from   sherc_res   a   ,
  (   select   nodeid     from   sherc_subject   where   nodeid=   '1 '   or   nodepath   like   '%> 1> % ')   c     ,
  (select   id   from   ht_zygl   where     bz   = '0 '   )   b   ,
  sherc_medium   d   where     a.nodeid=   c.nodeid   and   a.id   =   b.id   and       a.mediumid=d.id

最后结果   大概有8万条记录   刷了好久   大概10分钟以上  
其中   sherc_re   有28万条
sherc_subject   有2万条
ht_zygl   有   8万条
大家帮帮忙   ~~

------解决方案--------------------
看看执行计划吧
------解决方案--------------------
select id from ht_zygl where bz = '0 '此条件的记录多少..看看数据的分布,是用full scan还是用index scan的好..