减少SQL使用的缓冲区大小(Oracle性能调优)

时间:2011-11-30 07:17:17

标签: oracle performance

我正在尝试减少SQL使用的缓冲区大小。 以下是解释计划。

看一下解释计划,我倾向于关注下面的第3行

3 NESTED LOOPS  Cost: 1,407  Bytes: 11,902,228  Cardinality: 276,796    

因为成本从55(第2行)跳到1407

2 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_LN_PROD_U1 Cost: 55  Bytes: 247,359  Cardinality: 11,779  

我对此几乎没有问题:

  1. 我上面的分析是否围绕这些线路正确?
  2. 在第2行,它告诉我使用的索引是S_PROD_LN_PROD_U1,但实际上我们在S_PROD_LN表中没有S_PROD_LN_PROD_U1。我们有S_PROD_LN_U1索引。解释计划使用了什么样的"虚拟"索引?
  3. 第4行查看视图SYS.VW_NSO_1的含义
  4. 提前多多感谢。

    Plan
    SELECT STATEMENT  HINT: FIRST_ROWSCost: 2,101  Bytes: 2,563  Cardinality: 1                                                 
        32 NESTED LOOPS  Cost: 2,101  Bytes: 2,563  Cardinality: 1                                              
            29 NESTED LOOPS  Cost: 2,097  Bytes: 2,518  Cardinality: 1                                          
                27 NESTED LOOPS  Cost: 2,095  Bytes: 2,500  Cardinality: 1                                      
                    24 HASH JOIN RIGHT ANTI  Cost: 2,092  Bytes: 2,444  Cardinality: 1                                  
                        4 VIEW VIEW SYS.VW_NSO_1 Cost: 1,407  Bytes: 8,857,472  Cardinality: 276,796                            
                            3 NESTED LOOPS  Cost: 1,407  Bytes: 11,902,228  Cardinality: 276,796                        
                                1 TABLE ACCESS FULL TABLE SIEBEL.S_PROD_LN Cost: 83  Bytes: 528  Cardinality: 24                    
                                2 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_LN_PROD_U1 Cost: 55  Bytes: 247,359  Cardinality: 11,779                    
                        23 NESTED LOOPS OUTER  Cost: 104  Bytes: 39,200  Cardinality: 28                            
                            20 NESTED LOOPS OUTER  Cost: 50  Bytes: 37,604  Cardinality: 28                         
                                17 NESTED LOOPS OUTER  Cost: 50  Bytes: 36,540  Cardinality: 28                     
                                    14 NESTED LOOPS OUTER  Cost: 23  Bytes: 35,700  Cardinality: 28                 
                                        11 NESTED LOOPS OUTER  Cost: 23  Bytes: 34,300  Cardinality: 28             
                                            8 HASH JOIN RIGHT OUTER  Cost: 23  Bytes: 32,900  Cardinality: 28       
                                                5 TABLE ACCESS FULL TABLE SIEBEL.S_PROD_INT_CRSE Cost: 2  Bytes: 32,718  Cardinality: 82    
                                                7 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_PROD_INT Cost: 20  Bytes: 11,252  Cardinality: 29      
                                                    6 INDEX RANGE SCAN INDEX SIEBEL.S_PROD_INT_X2_X Cost: 3  
                                            10 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_LIT Cost: 0  Bytes: 50  Cardinality: 1        
                                                9 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_LIT_P1 Cost: 0  Cardinality: 1      
                                        13 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_LIT Cost: 0  Bytes: 50  Cardinality: 1            
                                            12 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_LIT_P1 Cost: 0  Cardinality: 1         
                                    16 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_PROD_LN Cost: 1  Bytes: 30  Cardinality: 1                
                                        15 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_LN_P1 Cost: 0  Cardinality: 1             
                                19 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_PROD_LN Cost: 0  Bytes: 38  Cardinality: 1                    
                                    18 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_LN_P1 Cost: 0  Cardinality: 1                 
                            22 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_PROD_INT Cost: 2  Bytes: 57  Cardinality: 1                       
                                21 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_INT_P1 Cost: 1  Cardinality: 1                    
                    26 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_VOD Cost: 3  Bytes: 56  Cardinality: 1                                
                        25 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_VOD_U2 Cost: 2  Cardinality: 1                              
                28 INDEX RANGE SCAN INDEX SIEBEL.S_ISS_OBJ_DEF_M3 Cost: 2  Bytes: 36  Cardinality: 2                                    
            31 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_VOD_VER Cost: 4  Bytes: 45  Cardinality: 1                                        
                30 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_VOD_VER_U1 Cost: 2  Cardinality: 1                                      
    

1 个答案:

答案 0 :(得分:0)

可以在此处找到有关如何解释Oracle解释计划的详细说明:http://www.akadia.com/services/ora_interpreting_explain_plan.html

在不了解底层数据库结构,表卷或查询这些表的SQL语句的情况下解释您的解释计划将非常困难。