金融其它

如何提升关联子查询的IO效率?

有的时候我会使用内外关联的子查询比如 select c.aid,c.name from db2china c where exists ( select * from club d   where c.aid=d.masterid   and d.job like '%Engineer') 我们该如何做确保该子查询的IO效率最佳?...显示全部
有的时候我会使用内外关联的子查询比如
select c.aid,c.name
from db2china c
where exists
( select * from club d
  where c.aid=d.masterid
  and d.job like '%Engineer')


我们该如何做确保该子查询的IO效率最佳?收起
参与7

查看其它 5 个回答欧阳峰的回答

欧阳峰欧阳峰其它Freelancer
1.在关联字段上建立索引
2.不管是exist也好,in也好,还是表关联写法也好,都需要看执行计划,然后取最好的哪个
IT其它 · 2013-10-31
浏览404

回答者

欧阳峰 最近回答过的问题

回答状态

  • 发布时间:2013-10-31
  • 关注会员:1 人
  • 回答浏览:404
  • X社区推广