zoukankan      html  css  js  c++  java
  • 创建本地索引和全局索引

    LOCALITY:表明分区索引是LOCAL的还是GLOBAL的。

    --创建分区索引:
    create index IDX_MGR_BASE_MGR on T_PM_MGR_BASE (MGR_CODE) LOCAL parallel 16 nologging ;
    SQL> select * from T_PM_MGR_BASE  where data_date=20131012 and mgr_code='03319';
    
    184 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 949292481
    
    -----------------------------------------------------------------------------------------------------------------------
    | Id  | Operation			   | Name	      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -----------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT		   |		      |   195 | 29250 |   196	(0)| 00:00:03 |       |       |
    |   1 |  PARTITION LIST SINGLE		   |		      |   195 | 29250 |   196	(0)| 00:00:03 |   KEY |   KEY |
    |   2 |   TABLE ACCESS BY LOCAL INDEX ROWID| T_PM_MGR_BASE    |   195 | 29250 |   196	(0)| 00:00:03 |   654 |   654 |
    |*  3 |    INDEX RANGE SCAN		   | IDX_MGR_BASE_MGR |   195 |       |     3	(0)| 00:00:01 |   654 |   654 |
    -----------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       3 - access("MGR_CODE"='03319')
    

    走了本地索引:
    
    create index IDX_MGR_BASE_MGR on T_PM_MGR_BASE (MGR_CODE)  parallel 16 nologging ;
    ---创建全局索引
    SQL> select index_name from dba_indexes  where index_name='IDX_MGR_BASE_MGR';
    
    INDEX_NAME
    ------------------------------
    IDX_MGR_BASE_MGR
    
    SQL>  explain plan for select * from T_PM_MGR_BASE where mgr_code='03319';
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display());
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Plan hash value: 158496794
    
    -----------------------------------------------------------------------------------------------------------------------
    | Id  | Operation			   | Name	      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -----------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT		   |		      | 91239 |    13M| 90120	(1)| 00:18:02 |       |       |
    |   1 |  TABLE ACCESS BY GLOBAL INDEX ROWID| T_PM_MGR_BASE    | 91239 |    13M| 90120	(1)| 00:18:02 | ROWID | ROWID |
    |*  2 |   INDEX RANGE SCAN		   | IDX_MGR_BASE_MGR | 91239 |       |   272	(1)| 00:00:04 |       |       |
    -----------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - access("MGR_CODE"='03319')
    
    14 rows selected.
    
    
    

  • 相关阅读:
    How to join (ap invoice distributions all) AP table info with PO Table
    Order Management APIs Oe_Order_Pub
    R12 Oe_Order_Pub API
    物料搬运单
    Process Order API In Order Management(详细)
    ap_invoice_distributions_all与PO表关联问题
    分配用人单位
    oe_order_pub 更改订单行数量,提示此更改的原因未提供或无效
    Order Management APIs
    提前期
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/3798101.html
Copyright © 2011-2022 走看看