首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

怎么提高此语句的查询速度。

2012-01-05 
如何提高此语句的查询速度。?select0asaddcol,a.id,a.title,a.mediumid,d.firstcontfromsherc_resa,(select

如何提高此语句的查询速度。?
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的好..

热点排行
Bad Request.