in list查詢計算cost
plan for
2 select /*+ index(wxh_tbd) */ object_name from wxh_tbd where object_id =:1;
2 select /*+ index(wxh_tbd) */ object_name from wxh_tbd where object_id =:1;
Explained.
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3726906094
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3726906094
---------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 3533 | 74193 | 212 (0)| 00:00:03 |
| 1 | TABLE ACCESS BY INDEX ROWID| WXH_TBD | 3533 | 74193 | 212 (0)| 00:00:03 |
|* 2 | INDEX RANGE SCAN | T_I | 3533 | | 32 (0)| 00:00:01 |
---------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 3533 | 74193 | 212 (0)| 00:00:03 |
| 1 | TABLE ACCESS BY INDEX ROWID| WXH_TBD | 3533 | 74193 | 212 (0)| 00:00:03 |
|* 2 | INDEX RANGE SCAN | T_I | 3533 | | 32 (0)| 00:00:01 |
---------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
---------------------------------------------------
2 - access("OBJECT_ID"=TO_NUMBER(:1))
14 rows selected.
plan for
2 select /*+ index(wxh_tbd) */ object_name from wxh_tbd where object_id in (:1,:2,:3);
2 select /*+ index(wxh_tbd) */ object_name from wxh_tbd where object_id in (:1,:2,:3);
Explained.
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1635227538
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1635227538
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 10598 | 217K| 631 (0)| 00:00:08 |
| 1 | INLIST ITERATOR | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID| WXH_TBD | 10598 | 217K| 631 (0)| 00:00:08 |
|* 3 | INDEX RANGE SCAN | T_I | 10598 | | 92 (0)| 00:00:02 |
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 10598 | 217K| 631 (0)| 00:00:08 |
| 1 | INLIST ITERATOR | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID| WXH_TBD | 10598 | 217K| 631 (0)| 00:00:08 |
|* 3 | INDEX RANGE SCAN | T_I | 10598 | | 92 (0)| 00:00:02 |
----------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
---------------------------------------------------
3 - access("OBJECT_ID"=TO_NUMBER(:1) OR "OBJECT_ID"=TO_NUMBER(:2) OR
"OBJECT_ID"=TO_NUMBER(:3))
"OBJECT_ID"=TO_NUMBER(:3))
16 rows selected.
(92-32)/2 from dual;
(92-32)/2
----------
30
----------
30
可以看到in list列表為3的時候,索引部分的cost值為92.也就是其餘兩個繫結值索引部分的cost為30.少了blevel部分。我想這主要是ORACLE在計算in list查詢的時候,考慮到了cache的影響
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22034023/viewspace-713998/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle cost計算方式Oracle
- Mysql日期查詢listMySql
- 等頻直方圖,計算COST直方圖
- oracle cost計算(轉自itpub網友)Oracle
- MongoDB 怎麼計運算元查詢MongoDB
- 計算機論文查詢網站計算機網站
- c++map 查詢元素和list查詢元素速度對比C++
- in_list查詢與or擴充套件套件
- c++中的查詢list元素C++
- OPTIMIZER_INDEX_COST_ADJ與成本計算Index
- oracle實驗記錄 (計算hash join cost)Oracle
- 計算表掃描中執行計劃的COST
- mysql查詢中時間、日期加減計算MySql
- [zt] CBO在查詢中如何計算成本
- 查詢計劃中集的勢(Cardinality)的計算
- 【轉】OPTIMIZER_INDEX_COST_ADJ與成本計算Index
- Hql總結 查詢結果動態組裝成List(map),List(bean),List(list),List(set)等格式(轉)Bean
- 查詢計算大檔案的桌面程式工具
- python 計算list的方差Python
- noworkload下全表掃描cost的計算
- 列表:list[1],切片list[1:3],追加insert,修改,刪除remove,del,pop,查詢index,統計count,清空list.clear() 翻轉list.reverse(),...REMIndex
- oracle實驗記錄 (FTS的cost與基數計算)Oracle
- oracle實驗記錄 (全表掃描COST計算方法)Oracle
- 好程式設計師雲端計算學習路線分享雲端計算之檔案查詢程式設計師
- 雲端計算學習素材框架,msyql查詢操作課件框架
- 海量資料相似度計算之simhash短文字查詢
- stl 中list 或者vector正確使用find查詢類物件物件
- CBO Cost Formulas基於成本優化器的成本計算公式大全ORM優化公式
- oracle實驗記錄 (oracle b*tree index訪問Cost計算(1))OracleIndex
- TDengine3.0計算查詢引擎的最佳化與升級
- 關於查詢表資料,列與CPU開銷的計算
- 如何從SharePoint Content DB中查詢List資料
- 通用查詢設計思想
- Mac計算機上如何輕鬆查詢和刪除類似照片Mac計算機
- MongoDB之資料查詢(關係運算)MongoDB
- MongoDB之資料查詢(邏輯運算)MongoDB
- MongoDB之資料查詢(範圍運算)MongoDB
- explain 查詢執行計劃AI