通过外连接提高SQL性能(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-02-02 17:50 点击:次
select a.CID from
v_contents a,
(select distinct b.fieldvalue from v_contentdatavisual_zh b, v_contents c
where c.type=1 and c.updateflg!='2' and b.cid=c.cid and b.fieldid like 'download_onlineServiceID'
and b.fieldvalue is not null) b
where a.cid=b.fieldvalue(+) and b.fieldvalue is null
and
a.spid like '%' and a.type=98 and a.updateflg = '0' and a.curstatus='5'
修改之后的执行计划如下:
SQL> @?/rdbms/admin/utlxpls
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | By
tes | Cost |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | |
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
| |
| 1 | FILTER | | |
| |
| 2 | MERGE JOIN OUTER | | |
| |
| 3 | SORT JOIN | | |
| |
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
| 4 | TABLE ACCESS FULL | CONTENTS | |
| |
| 5 | SORT JOIN | | |
| |
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>