關於隱含引數_b_tree_bitmap_plans
最近碰到這樣一個SQL:
SELECT DISTINCT T_GOODS_DECL.DECL_NO,T_GOODS_DECL.DECL_REG_NO,
T_GOODS_DECL.DECL_PERSON_CODE,T_GOODS_DECL.DECL_DATE,
T_GOODS_DECL.CONSIGNOR_CNAME,T_GOODS_DECL.CONSIGNEE_CNAME, T_GOODS_DECL.PROCESS_STATUS,T_GOODS_DECL.DECL_GET_NO,
T_GOODS_DECL.DEST_CODE,T_GOODS_DECL.DECL_TYPE_CODE,
T_GOODS_DECL.INSP_ORG_CODE,
T_GOODS_DECL.INSP_ORG_CODE||T_GOODS_DECL.INSP_DEPT_1,
T_GOODS_DECL.DEST_ORG_CODE
FROM T_GOODS_DECL,T_DECL_GOODS
WHERE ( T_GOODS_DECL.DECL_NO = T_DECL_GOODS.DECL_NO )
AND t_goods_decl.decl_date <= to_date( '2007.09.25','YYYY.MM.DD')
and t_goods_decl.decl_reg_no = '3803000061'
and decl_type_code like '2_'
and org_code like'380300'
執行計劃是:
--------------------------------------------------------------------------------
| Operation | PHV/Object Name | Rows | Bytes| Cost |
--------------------------------------------------------------------------------
|SELECT STATEMENT |----- 4171074745 ----| | | 98 |
|SORT UNIQUE | | 1 | 139 | 98 |
| TABLE ACCESS BY INDEX ROWID |T_GOODS_DECL | 1 | 123 | 83 |
| NESTED LOOPS | | 2 | 278 | 83 |
| INDEX FAST FULL SCAN |IDX_DECL_NO | 398K| 6M| 4 |
| BITMAP CONVERSION TO ROWIDS | | | | |
| BITMAP AND | | | | |
| BITMAP CONVERSION FROM ROWI| | | | |
| INDEX RANGE SCAN |PK_T_GOODS_DECL | 1M| | |
| BITMAP CONVERSION FROM ROWI| | | | |
| INDEX RANGE SCAN |X_GOODS_DECL_REG_NO | 1M| | |
--------------------------------------------------------------------------------
效率非常低,其中
PK_T_GOODS_DECL是T_GOODS_DECL上的主鍵(decl_no)
IDX_DECL_NO是T_DECL_GOODS(decl_no)上的索引
X_GOODS_DECL_REG_NO是T_GOODS_DECL(decl_reg_no)上的索引,選擇性還不錯
按個人的想法,訪問T_GOODS_DECL只需要走X_GOODS_DECL_REG_NO就可以了,果然加提示/*+NO_INDEX(T_GOODS_DECL PK_T_GOODS_DECL)*/後效能大為改觀,然而應用是不能修改的,經同事指點,原來需要將隱含引數_b_tree_bitmap_plans設定為false.
from metalink:
* fact: Oracle Server - Enterprise Edition 9.2
* fact: Oracle Server - Enterprise Edition 9.0.1
* fact: Oracle Server - Enterprise Edition 7.3.4
* fact: Oracle Server - Enterprise Edition 8.1.7
* symptom: Execution plan operation shows bitmap conversion from rowids
* symptom: No bitmap indexes
* symptom: Execution plan shows BITMAP CONVERSION
* cause: In 7.3.4 and in 8.1.7 default value of _b_tree_bitmap_plans is FALSE whereas as of 9.0.1 (and 9.2) the default value is TRUE When _b_tree_bitmap_plans set to true (advice not to change the default setting yourself) the optimizer is allowed to produce bitmap plans for normal b*tree indexes even if no bitmap indexes set.
fix:
This is intended behaviour if _b_tree_bitmap_plans set to true
If this is unwanted leave _b_tree_bitmap_plans at default value (false)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/85922/viewspace-976999/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【ASM學習】關於 ASM 的隱含引數ASM
- Oracle 隱含引數Oracle
- ORACLE隱含引數Oracle
- Oracle direct path read相關隱含引數Oracle
- _b_tree_bitmap_plans引數
- oracle獲取隱含引數Oracle
- 隱含引數的查詢
- Oracle的隱含引數(zt)Oracle
- 獲取Oracle隱含引數資訊Oracle
- 獲取oracle的隱含引數Oracle
- oracle的一個隱含引數Oracle
- Oracle 中所有隱含的 引數Oracle
- Oracle隱含引數的查詢Oracle
- 探究隱含引數_fairness_thresholdAI
- 常用指令碼:獲取隱含引數指令碼
- oracle 檢視隱含引數指令碼Oracle指令碼
- oracle 11g常用隱含引數Oracle
- [zt] 如何檢視Oracle 隱含引數Oracle
- 【PARANETERS】Oracle異常恢復相關的隱含引數Oracle
- oracle隱含引數的檢視與修改Oracle
- 【parameter】oracle的隱含引數的檢視Oracle
- Oracle 隱含引數 : _allow_resetlogs_corruptionOracle
- Oracle 隱含引數 _disable_loggingOracle
- 隱含引數的查詢x$ksppi,x$ksppcv
- v$動態效能檢視和隱含引數
- CBO,ORACLE,隱含引數,_sort_elimination_cost_ratio的含義Oracle
- 隱含引數_minimum_giga_scn的理解
- 使用隱含Trace引數診斷Oracle Data Pump故障Oracle
- 獲取_字首的oracle hidden parameter隱含引數Oracle
- [zt] Oracle10g 隱含引數 - LOG_PARALLELISMOracleParallel
- 使用隱含Trace引數診斷Oracle Data Pump(expdp)故障Oracle
- 查詢資料庫隱含引數的sql語句資料庫SQL
- Oracle引數-隱藏引數Oracle
- Oracle 11G 隱含引數“_controlfile_autobackup_delay”Oracle
- 【指令碼】隱含引數及註釋資訊的查詢方法指令碼
- 關於靜態引數和動態引數
- [20190401]隱含引數_mutex_spin_count.txtMutex
- Oracle 11g中的_optimizer_null_aware_antijoin隱含引數OracleNull