bitmap conversion from rowids
最近剛接手一個系統(好像是TMS物流系統),資料庫伺服器有三個節點,版本為10.2.0.5。
由於是剛接手,所以先大概看了一下基本情況。情況基本理想,存在一些稍高的等待事件、高消耗sql等。需一步一步將效能提上來。
今天先優化了一條比較簡單的sql(單表的一個count查詢),這條sql邏輯讀排第一。
Execution Plan ---------------------------------------------------------- Plan hash value: 833335278 ----------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 43 |276 (2)| 00:00:04 | | 1 | SORT AGGREGATE | | 1 | 43 | | | |* 2 | TABLE ACCESS BY INDEX ROWID | LEG | 1 | 43 |276 (2)| 00:00:04 | | 3 | BITMAP CONVERSION TO ROWIDS | | | | | | | 4 | BITMAP AND | | | | | | | 5 | BITMAP CONVERSION FROM ROWIDS| | | | | | | 6 | SORT ORDER BY | | | | | | |* 7 | INDEX RANGE SCAN | LEG_PLAN_S_TIME | 167 | |106 (0)| 00:00:02 | | 8 | BITMAP CONVERSION FROM ROWIDS| | | | | | |* 9 | INDEX RANGE SCAN | LEG_CARRIER | 167 | |162 (1)| 00:00:02 | ----------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - filter("LEG0_"."PLATFORM_ID"=16143 AND "LEG0_"."STATUS"='WAITPLAN' AND ("LEG0_"."LEG_TYPE"='DGPS' OR "LEG0_"."LEG_TYPE"='JZPS' OR "LEG0_" ."LEG_TYPE"='MDPS' OR "LEG0_"."LEG_TYPE"='TXHH') AND "LEG0_"."PLAN_ARRIVE_E_TIME">SYSDAT E@!) 7 - access("LEG0_"."PLAN_ARRIVE_S_TIME"從執行計劃和統計資訊可以看出:
1、邏輯讀20多萬,存在一次記憶體排序
2、存在點陣圖轉換(bitmap coversion from rowids)
實際上只有where+count不應該有排序。檢視錶的相關情況,索引比較多,且存在重複的情況。索引建立有失合理
不修改索引的提下點陣圖轉換可以通過隱含引數_b_tree_bitmap_plans設定為fals,禁止點陣圖轉換。
alter session set "_b_tree_bitmap_plans"=false
或者
新增Hint:/*+opt_param('_b_tree_bitmap_plans','false')*/Execution Plan ---------------------------------------------------------- Plan hash value: 2313119379 ----------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 43 | 1428(1)| 00:00:18 | | 1 | SORT AGGREGATE | | 1 | 43 | | | | 2 | INLIST ITERATOR | | | | | | |* 3 | TABLE ACCESS BY INDEX ROWID| LEG | 1 | 43 | 1428(1)| 00:00:18 | |* 4 | INDEX RANGE SCAN | IND_WRITE_SDC | 167 | | 1311(1)| 00:00:16 | ----------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter("LEG0_"."CARRIER_ID"=20402 AND "LEG0_"."PLAN_ARRIVE_S_TIME"目前系統還沒有解決這條語句,需要進一步熟悉環境和流程後正式解決。SYSDATE@!) 4 - access("LEG0_"."STATUS"='WAITPLAN' AND ("LEG0_"."LEG_TYPE"='DGPS' OR "LEG0_"."LEG_TYPE"='JZPS' OR "LEG0_"."LEG_TYPE"='MDPS' OR "LEG0_"."LEG_TYPE"='TXHH') AND "LEG0_"."PLATFORM_ID"=16143) filter("LEG0_"."PLATFORM_ID"=16143) Statistics ---------------------------------------------------------- 8 recursive calls 0 db block gets 7409 consistent gets 0 physical reads 0 redo size 514 bytes sent via SQL*Net to client 492 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed
參考:
http://www.eygle.com/archives/2011/12/bitmap_conversion_cpu.html
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26831783/viewspace-1695145/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- invalid conversion from ‘LRUCache*‘ to ‘int‘ [-fpermissive] /new的使用
- PSQLException: ERROR: failed to find conversion function from unknown to charSQLExceptionErrorAIFunction
- Leetcode 6 ZigZag ConversionLeetCode
- LeetCode 6. ZigZag ConversionLeetCode
- what is conversion exit defined in ABAP domainAI
- LeetCode T6 ZigZag ConversionLeetCode
- c# svg轉Bitmap Bitmap轉ImageSourceC#SVG
- Jedis bitmap
- LeetCode ZigZag Conversion(006)解法總結LeetCode
- Conversion to Dalvik format failed: Unable to execute dexORMAI
- Bitmap回收—Canvas: trying to use a recycled bitmap android.graphicsCanvasAndroid
- Android Bitmap 使用Android
- 理解Android BitmapAndroid
- BitMap介紹
- Bitmap、RoaringBitmap原理分析
- Android Bitmap優化Android優化
- 7.37 BITMAP_OR_AGG
- 7.36 BITMAP_COUNT
- 演算法---BitMap演算法
- BitMap與RoaringBitmap、JavaEWAHJava
- Android: Bitmap/Canvas/DrawableAndroidCanvas
- Android中的BitmapAndroid
- WPF Bitmap轉imagesource
- 獲取bitmap大小
- PostgreSQL DBA(98) - PG 12 Faster float conversion to textSQLAST
- LeetCode6: ZigZag Conversion(Z字形變換)LeetCode
- Bitmap Indexing in DBMS Bitmap Index vs. B-tree Index low cardinalityIndex
- 7.35 BITMAP_CONSTRUCT_AGGStruct
- 7.34 BITMAP_BUCKET_NUMBER
- 7.33 BITMAP_BIT_POSITION
- Redis 中 Bitmap 詳解Redis
- Clickhouse的bitmap函式函式
- Android-認識BitmapAndroid
- Bitmap優化詳談優化
- 探索Bitmap使用姿勢
- bitMap原理及實戰
- Android JNI 之 Bitmap 操作Android
- android bitmap壓縮方案Android
- 如何使用 SAP CDS view 中的 currency conversion 功能View