CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Oracle >  开发

优化查询语句

楼主llin998(浓茶水)2006-03-15 11:57:02 在 Oracle / 开发 提问

select   *   from   t_resource_cell   where   res_id   in   (   select   c.res_id   from   t_resource_cell   c     inner   join   t_resource_type   t   on   c.res_id   =   t.res_id     where   c.status   !=   'D'     and   c.mtype_id   in   (select   mtype_id   from   d_resource_mtype   where   parent_id   in   ('RT')   or   mtype_id   in   ('RT')   )         and   (   (c.tmcp_id   is   not   null   and   c.tmcp_id   in   ('BQ0007'))   or   (c.tmcp_id   is   null   and   c.res_id   in   (   select   res_id   from   t_resource_tmcp   where   tmcp_id   in   ('BQ0007')   )   )   )             and   t.type1_id   =   '2100'   and   t.type2_id   =   '8100'         )    
   
  请帮忙看看怎么能将这个查询优化一下! 问题点数:100、回复次数:3Top

1 楼zlz_212(ShREk)回复于 2006-03-15 13:13:09 得分 10

in   操作看看是否可以替换成其他的,比如existsTop

2 楼bobfang(匆匆过客)回复于 2006-03-15 13:56:34 得分 80

select   *   from   t_resource_cell   c  
          where   c.status   !=   'D'  
              and   c.mtype_id   in   (select   mtype_id   from   d_resource_mtype   where   parent_id   in   ('RT')   or   mtype_id   in   ('RT')   )  
              and   (       (c.tmcp_id   is   not   null   and   c.tmcp_id   in   ('BQ0007')   )  
                        or   (c.tmcp_id   is   null   and   c.res_id   in   (   select   res_id   from   t_resource_tmcp   where   tmcp_id   in   ('BQ0007')   )   )   )  
              and   exists   (select   1   from   t_resource_type   t  
                                              where   c.res_id   =   t.res_id  
                                                  and   t.type1_id   =   '2100'   and   t.type2_id   =   '8100')Top

3 楼cenlmmx(学海无涯苦作舟)回复于 2006-03-15 14:06:28 得分 10

这个基本没讨论的价值,没版本信息,没表的数据信息,哪种优化模式和执行计划...  
  Top

相关问题

  • SQL查询语句优化
  • 帮忙优化一个查询语句
  • SQL查询语句优化,[超难]
  • 查询语句的优化问题
  • 查询语句优化问题(急!!)
  • 查询语句
  • 查询语句
  • 查询语句
  • 查询语句的优化问题???来者有分
  • 请教一个查询语句的优化

关键词

  • cell
  • null
  • tmcp
  • mtype
  • bq0007
  • resource
  • res
  • rt
  • where
  • select

得分解答快速导航

  • 帖主:llin998
  • zlz_212
  • bobfang
  • cenlmmx

相关链接

  • Oracle类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo