利用sql改写去掉执行计划中的filter
2016-10-28 14:52
225 查看
由于涉及到一下敏感的数据,所以只能用试验环境演示,情况如下:
create table test as select * from dba_objects ;
create table test1 as select * from dba_objects ;
select *
from (select *
from test b
where created = (select max(created)
from test1 a
where a.object_name = b.object_name)
and last_ddl_time > sysdate) a,
(select *
from test b
where created = (select max(created)
from test1 a
where a.object_name = b.object_name)
and last_ddl_time < sysdate) b
where a.object_id = b.object_id;
执行计划如下:
select * from (select *
from test b,
(select object_name, max(created) created
from test1 a
group by object_name) a
where a.created = b.created
and a.object_name = b.object_name
and last_ddl_time > sysdate) a,
(select *
from test b,
(select object_name, max(created) created
from test1 a
group by object_name) a
where a.created = b.created
and a.object_name = b.object_name
and last_ddl_time > sysdate) b
where a.object_id = b.object_id;
create table test as select * from dba_objects ;
create table test1 as select * from dba_objects ;
select *
from (select *
from test b
where created = (select max(created)
from test1 a
where a.object_name = b.object_name)
and last_ddl_time > sysdate) a,
(select *
from test b
where created = (select max(created)
from test1 a
where a.object_name = b.object_name)
and last_ddl_time < sysdate) b
where a.object_id = b.object_id;
执行计划如下:
select * from (select *
from test b,
(select object_name, max(created) created
from test1 a
group by object_name) a
where a.created = b.created
and a.object_name = b.object_name
and last_ddl_time > sysdate) a,
(select *
from test b,
(select object_name, max(created) created
from test1 a
group by object_name) a
where a.created = b.created
and a.object_name = b.object_name
and last_ddl_time > sysdate) b
where a.object_id = b.object_id;
相关文章推荐
- 利用pl/sql执行计划评估SQL语句的性能
- 利用pl/sql执行计划评估SQL语句的性能简析
- 利用AWR 查看SQL 执行计划
- 转://利用从awr中查找好的执行计划来优化SQL
- 利用pl/sql执行计划评估SQL语句的性能简析
- 利用pl/sql执行计划评估SQL语句的性能简析
- 利用pl/sql执行计划评估SQL语句的性能简析
- 利用任务计划定时执行SQL语句
- 优化---利用pl/sql执行计划评估SQL语句的性能简析
- 利用pl/sql执行计划评估SQL语句的性能简析
- 利用pl/sql执行计划评估SQL语句的性能简析
- MySQL数据库性能优化-利用sql执行计划预先查看执行性能(五)
- 利用pl/sql执行计划评估SQL语句的性能简析
- 利用AWR 查看SQL 执行计划
- Mysql利用profiles来查看sql 语句执行计划
- 利用statspack来获取生成环境中top SQL及其执行计划
- 利用statspack来获取生成环境中top SQL及其执行计划
- 利用从awr中查找好的执行计划来优化SQL
- 如何查看oracle sql执行计划