遭遇Bug 5766310 Bad join cardinality is in the presence of histograms
還是上篇提到的SQL
http://sundog315.itpub.net/post/308/524769
修改完畢後,在某一特定伺服器,效能仍然存在問題,看了一下執行計劃,確實是有問題的
擷取相關的執行計劃
35 | HASH GROUP BY | | 1 | 150 | 398 (2)| 00:00:05 | | |
|* 36 | FILTER | | | | | | | |
|* 37 | TABLE ACCESS BY INDEX ROWID | SELLPAYGOODS | 1 | 34 | 3 (0)| 00:00:01 | | |
| 38 | NESTED LOOPS | | 1 | 150 | 397 (1)| 00:00:05 | | |
| 39 | NESTED LOOPS | | 1 | 116 | 394 (1)| 00:00:05 | | |
| 40 | NESTED LOOPS | | 6 | 546 | 382 (1)| 00:00:05 | | |
| 41 | MERGE JOIN CARTESIAN | | 1 | 45 | 336 (1)| 00:00:05 | | |
|* 42 | TABLE ACCESS FULL | GOODSMFRAME | 1 | 25 | 333 (1)| 00:00:04 | | || 43 | BUFFER SORT | | 1 | 20 | 3 (0)| 00:00:01 | | |
|* 44 | TABLE ACCESS FULL | PAYMODE | 1 | 20 | 3 (0)| 00:00:01 | | |
| 45 | REMOTE | SELLDETAIL | 17 | 782 | 46 (0)| 00:00:01 | POS_DB | R->S |
| 46 | REMOTE | SELLHEAD | 1 | 25 | 2 (0)| 00:00:01 | POS_DB | R->S |
|* 47 | INDEX RANGE SCAN | PK_SELLPAYGOODS | 1 | | 2 (0)| 00:00:01 | | |
黑色部分是重要的部分,10053看一下
Column (#3): GMFMARKET(VARCHAR2)
AvgLen: 5.00 NDV: 36 Nulls: 0 Density: 3.6593e-06 Histogram: Freq #Bkts: 36 UncompBkts: 136637 EndPtVals: 36
Table: GOODSMFRAME Alias: GOODSMFRAME
Card: Original: 136637 Rounded: 1 Computed: 0.50 Non Adjusted: 0.50
而實際上,這裡的資料量是1萬多條,差距太大了
應該是觸發了Bug 5766310 - Bad join cardinality is in the presence of histograms [ID 5766310.8]
刪除直方圖後,恢復了正常的執行計劃
Column (#3): GMFMARKET(VARCHAR2)
AvgLen: 5.00 NDV: 36 Nulls: 0 Density: 0.027778 Table: GOODSMFRAME Alias: GOODSMFRAME
Card: Original: 136661 Rounded: 3796 Computed: 3796.14 Non Adjusted: 3796.14
Bug 5766310 Bad join cardinality is in the presence of histograms
This note gives a brief overview of bug 5766310.The content was last updated on: 01-DEC-2009
Click for details of each of the sections below.
Affects:
Product (Component) Oracle Server (Rdbms) Range of versions believed to be affected Versions < 11 Versions confirmed as being affected
Platforms affected Generic (all / most platforms affected)
Fixed:
This issue is fixed in
Symptoms: | Related To: |
Description
The presence of frequency histogram can lead to low cardinality estimation and a suboptimal execution plan. This fix changes the way density is calculated with height balance histograms too; and with data skewness and almost-popular values can underestimate cardinalities. Workaround Drop the frequency histogram that is on the predicate column. Note: This fix is disable by _fix_control of
Please note: The above is a summary description only. Actual symptoms can vary. Matching to any symptoms here does not confirm that you are encountering this problem. Always consult with Oracle Support for advice. |
References
Bug:5766310 (This link will only work for PUBLISHED bugs)
Note:245840.1 Information on the sections in this article
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19423/viewspace-1056127/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [求助]Laravel使用presence的時候,Unable to join channelLaravel
- mysql xtrabackup 遭遇嚴重bugMySql
- HistogramsHistogram
- oracle 10.2.4 遭遇bug 當機Oracle
- Oracle HistogramsOracleHistogram
- 解Bug之路-Nginx 502 Bad GatewayNginxGateway
- 遭遇mysql 5.6.10 BUG 一例MySql
- Oracle11g bug - kewastUnPackStats(),bad magic 1OracleAST
- oracle11.2 BUG kewastUnPackStats(): bad magic 1OracleAST
- MySQL 5.6 遭遇 OS bug INNODB MONITOR OUTPUT 事件MySql事件
- delete操作時遭遇ora-600 bug[kntgslm]delete
- 直方圖(histograms)直方圖Histogram
- 升級Grid Infrastructure到10.2.0.2 遭遇bug 9413827ASTStruct
- 遭遇ORA-600 [kgscLogOff-notempty] bugGo
- oracle 柱狀圖(Histograms)OracleHistogram
- [zt] Histograms - 直方圖Histogram直方圖
- Cardinality
- 7.40 CARDINALITY
- 遭遇ora-600 [qkacon:FJswrwo], [3] oracle 10.2.0.4 bugJSOracle
- 【SQL 學習】表連線--natural join 的一個bugSQL
- join、inner join、left join、right join、outer join的區別
- 遭遇 bug InnoDB: Failing assertion: page_get_n_recs(page) > 1AI
- oracle10.2.0.5.0遭遇ORA-26773錯誤-Bug 5623403Oracle
- 關於Oracle full outer join 的bug問題分析及處理Oracle
- Bad Habits
- MySQL LEFT JOIN/ INNER JOIN/RIGHT JOINMySql
- Oracle Database Cardinality FeedbackOracleDatabase
- Cardinality指什麼?
- Cardinality (222)
- Cardinality的計算
- presence_of_element_located對比visibility_of_element_located
- 直方圖Histograms與CRUSOR_SHARING直方圖Histogram
- sql中的join、left join、right joinSQL
- Hbase master gone 系統崩潰. 遭遇 hbase bug 以及對應的解決方案.ASTGo
- 16.基數(Cardinality)
- CARDINALITY HINT用法小試
- 10g中的histograms stats自動收集Histogram
- Oracle直方圖 (柱狀圖 histograms) 詳解Oracle直方圖Histogram