暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

oracle 动态采样

oracle分享技术 2021-02-06
365

1.查看表分析情况


SQL> select T.LAST_ANALYZED from dba_tables t where owner = 'TEST' and  table_name  ='WH';


LAST_ANAL
---------
xxx


2.删除表分析信息


exec DBMS_STATS.DELETE_TABLE_STATS('test','wh');


3.执行sql 观察


SQL> select  count(*) from test.wh  where object_id > 80 and object_id < 30;


Execution Plan
----------------------------------------------------------
Plan hash value: 1304248303


----------------------------------------------------------------------------
| Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |      |     1 |    13 |     0   (0)|          |
|   1 |  SORT AGGREGATE     |      |     1 |    13 |            |          |
|*  2 |   FILTER            |      |       |       |            |          |
|*  3 |    TABLE ACCESS FULL| WH   |    12 |   156 |   297   (1)| 00:00:04 |
----------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   2 - filter(NULL IS NOT NULL)
   3 - filter("OBJECT_ID">80 AND "OBJECT_ID"<30)


Note
-----
   - dynamic sampling used for this statement (level=2)




提示为动态采样

文章转载自oracle分享技术,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论