该语句在awr报告里占了总逻辑读的61%,请各位看看是什么原因

[复制链接]
查看11 | 回复6 | 2009-5-13 15:15:08 | 显示全部楼层 |阅读模式
语句如下:
select *
from (select t.id,

t.product_code,

t.product_is_gift,

t.default_picture_url,

t.product_cname,

t.product_ename
from product t
join product_merchant pm on pm.product_id = t.id

and pm.default_merchant = 1

where t.id < :1

and t.category_id = :2

and t.IS_DELETED = 0

and t.CAN_SALE = 1

order by id desc)
where rownum < 2
在awr报告里,gets/per exec 为47,330.91,但是我单独执行时(把两个参数换为值),在执行计划里显示gets为4,请教各位高手,是什么原因,
回复

使用道具 举报

千问 | 2009-5-13 15:15:08 | 显示全部楼层
awr可以提取当时的执行计划。
提取出来看看。
回复

使用道具 举报

千问 | 2009-5-13 15:15:08 | 显示全部楼层
请问awr怎么提取该语句的执行计划
回复

使用道具 举报

千问 | 2009-5-13 15:15:08 | 显示全部楼层
你把这个sql的执行计划和表中有多少数据发上来看看
回复

使用道具 举报

千问 | 2009-5-13 15:15:08 | 显示全部楼层
V$SQL_PLAN在这个表中用sql_id把有用的信息提出来
回复

使用道具 举报

千问 | 2009-5-13 15:15:08 | 显示全部楼层
select * from table(dbms_xplan.display_awr('sql_id'));
回复

使用道具 举报

千问 | 2009-5-13 15:15:08 | 显示全部楼层
试下
select *
from (select /*+leading(t) use_nl(t pm)*/

t.id,

t.product_code,

t.product_is_gift,

t.default_picture_url,

t.product_cname,

t.product_ename

from product t,

product_merchant pm
where t.id < :1
and t.category_id = :2
and t.IS_DELETED = 0
and t.CAN_SALE = 1
andpm.product_id = t.id
and pm.default_merchant = 1
order by id desc)
where rownum < 2
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行