oracle sample是怎么扫描
答案:1 悬赏:30 手机版
解决时间 2022-01-01 01:10
- 提问者网友:十年饮冰
- 2021-12-31 20:54
oracle sample是怎么扫描
最佳答案
- 五星知识达人网友:孤独的牧羊人
- 2021-12-31 22:22
Oracle文档还提到基于BLOCK的SAMPLE扫描,只对全表扫描和快速索引全扫有效,而其他执行计划无效,不过索引扫描提供了一种类似实现方式:SYS_SAMPLE_BLOCK
SQL> SELECt OBJECT_ID FROM T SAMPLE BLOCK (1);
未选定行
执行计划
----------------------------------------------------------
Plan hash value: 2767392432
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECt STATEMENT | | 496 | 8432 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS SAMPLE| T | 496 | 8432 | 3 (0)| 00:00:01 |
----------------------------------------------------------------------------
统计信息
----------------------------------------------------------
219 recursive calls
0 db block gets
40 consistent gets
0 physical reads
0 redo size
275 bytes sent via SQL*Net to client
374 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
0 rows processed
SQL> SELECt OBJECT_ID FROM T SAMPLE BLOCK (1) WHERe OBJECT_ID IS NOT NULL;
未选定行
执行计划
----------------------------------------------------------
Plan hash value: 1022620004
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | SELECt STATEMENT | | 496 | 8432 | 2 (0)| 00:00:01 |
|* 1 | INDEX SAMPLE FAST FULL SCAN| IND_T_ID | 496 | 8432 | 2 (0)| 00:00:01 |
----------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID" IS NOT NULL)
统计信息
----------------------------------------------------------
1 recursive calls
0 db block gets
6 consistent gets
0 physical reads
0 redo size
275 bytes sent via SQL*Net to client
374 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
SQL> SELECt OBJECT_ID FROM T SAMPLE BLOCK (1);
未选定行
执行计划
----------------------------------------------------------
Plan hash value: 2767392432
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECt STATEMENT | | 496 | 8432 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS SAMPLE| T | 496 | 8432 | 3 (0)| 00:00:01 |
----------------------------------------------------------------------------
统计信息
----------------------------------------------------------
219 recursive calls
0 db block gets
40 consistent gets
0 physical reads
0 redo size
275 bytes sent via SQL*Net to client
374 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
0 rows processed
SQL> SELECt OBJECT_ID FROM T SAMPLE BLOCK (1) WHERe OBJECT_ID IS NOT NULL;
未选定行
执行计划
----------------------------------------------------------
Plan hash value: 1022620004
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | SELECt STATEMENT | | 496 | 8432 | 2 (0)| 00:00:01 |
|* 1 | INDEX SAMPLE FAST FULL SCAN| IND_T_ID | 496 | 8432 | 2 (0)| 00:00:01 |
----------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID" IS NOT NULL)
统计信息
----------------------------------------------------------
1 recursive calls
0 db block gets
6 consistent gets
0 physical reads
0 redo size
275 bytes sent via SQL*Net to client
374 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯