关于索引degree设置的问题

--并行查询
可以使用并行查询的情况
1. Full table scans, full partition scans, and fast full index scans
2.  Index full and range scans, but only if the index is partitioned (at a given time, a partition 
  can be accessed by a single slave process only; as a side effect, the degree of parallelism 
  is limited by the number of accessed partitions)
3.  Joins (Chapter 10 provides some examples)
4.  Set operators
5.  Sorts
6.  Aggregations

create index T46_IDX1 on T46_HX_ACCJ_ATOM_LIST_HIS_Q(set_date)
nologging parallel 4;

SQL> select index_name,degree from dba_indexes
  2  where index_name='T46_IDX1';

INDEX_NAME		       DEGREE
------------------------------ ----------------------------------------
T46_IDX1		       4

SQL_ID  c9ffc6rh2du8p, child number 0
-------------------------------------
select * from T46_HX_ACCJ_ATOM_LIST_HIS_Q where set_date='2013-03-03'
 
Plan hash value: 3257071247
 
-----------------------------------------------------------------------------------------------------------
| Id  | Operation                   | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |                             |       |       |  9583 (100)|          |
|   1 |  TABLE ACCESS BY INDEX ROWID| T46_HX_ACCJ_ATOM_LIST_HIS_Q | 69401 |    18M|  9583   (1)| 00:01:55 |
|*  2 |   INDEX RANGE SCAN          | T46_IDX1                    | 69401 |       |   217   (1)| 00:00:03 |
-----------------------------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
 
   2 - access("SET_DATE"='2013-03-03')
 

SQL> select count(set_date) from T46_HX_ACCJ_ATOM_LIST_HIS_Q;

COUNT(SET_DATE)
---------------
       74467523

SQL> select * from table(dbms_xplan.display_cursor(null,null,'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID	0ywk03qx547du, child number 1
-------------------------------------
select count(set_date) from T46_HX_ACCJ_ATOM_LIST_HIS_Q

Plan hash value: 1676932122

------------------------------------------------------------------------------------------------
| Id  | Operation		  | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------
|   1 |  SORT AGGREGATE 	  |	     |	    1 |      1 |      1 |00:00:12.22 |	     4 |
|   2 |   PX COORDINATOR	  |	     |	    1 |        |      4 |00:00:12.22 |	     4 |
|   3 |    PX SEND QC (RANDOM)	  | :TQ10000 |	    0 |      1 |      0 |00:00:00.01 |	     0 |
|   4 |     SORT AGGREGATE	  |	     |	    0 |      1 |      0 |00:00:00.01 |	     0 |
|   5 |      PX BLOCK ITERATOR	  |	     |	    0 |     74M|      0 |00:00:00.01 |	     0 |
|*  6 |       INDEX FAST FULL SCAN| T46_IDX1 |	    0 |     74M|      0 |00:00:00.01 |	     0 |
------------------------------------------------------------------------------------------------

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

   6 - access(:Z>=:Z AND :Z<=:Z)


22 rows selected. 




 

转载于:https://www.cnblogs.com/zhaoyangjian724/p/3797915.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值