Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:00:34+00:00 2026-05-26T17:00:34+00:00

I am trying to optimize one SQL that having below explain plan. I am

  • 0

I am trying to optimize one SQL that having below explain plan.

I am actually stuck at this particular line from the explain plan

45 NESTED LOOPS  Cost: 782  Bytes: 293,832  Cardinality: 212

If you notice the number of Bytes is 293K, and due to it is nested loops the number of buffer used by final SQL is millions.
And it is blocked by db profile.

Any general suggestions how to reduce the number of bytes of ROW 45 above?

Note on row 45 (from TOAD):

For each row retrieved by step 42, the operation in step 44 was performed to find a matching row

Thanks a lot

SELECT STATEMENT  HINT: ALL_ROWSCost: 800  Bytes: 7,844  Cardinality: 1                                                                                                         
    67 SORT ORDER BY  Cost: 800  Bytes: 7,844  Cardinality: 1                                                                                                   
        66 VIEW VIEW SYS.VM_NWVW_2 Cost: 800  Bytes: 7,844  Cardinality: 1                                                                                                  
            65 HASH UNIQUE  Cost: 800  Bytes: 1,672  Cardinality: 1                                                                                             
                64 NESTED LOOPS OUTER  Cost: 799  Bytes: 1,672  Cardinality: 1                                                                                          
                    61 NESTED LOOPS OUTER  Cost: 795  Bytes: 1,627  Cardinality: 1                                                                                      
                        58 NESTED LOOPS OUTER  Cost: 793  Bytes: 1,599  Cardinality: 1                                                                                  
                            55 NESTED LOOPS OUTER  Cost: 791  Bytes: 1,571  Cardinality: 1                                                                              
                                52 NESTED LOOPS OUTER  Cost: 790  Bytes: 1,537  Cardinality: 1                                                                          
                                    49 NESTED LOOPS OUTER  Cost: 788  Bytes: 1,491  Cardinality: 1                                                                      
                                        46 HASH JOIN  Cost: 786  Bytes: 1,442  Cardinality: 1                                                               
                                            2 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_POS_SKILL Cost: 4  Bytes: 56  Cardinality: 1                                                           
                                                1 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_POS_SKILL_U2 Cost: 3  Cardinality: 1                                                         
                                            45 NESTED LOOPS  Cost: 782  Bytes: 293,832  Cardinality: 212                                                            
                                                42 NESTED LOOPS OUTER  Cost: 722  Bytes: 4,056  Cardinality: 3                                                          
                                                    39 NESTED LOOPS OUTER  Cost: 719  Bytes: 3,909  Cardinality: 3                                                      
                                                        36 HASH JOIN  Cost: 716  Bytes: 3,795  Cardinality: 3                                               
                                                            33 NESTED LOOPS  Cost: 714  Bytes: 2,318  Cardinality: 2                                            
                                                                30 NESTED LOOPS OUTER  Cost: 710  Bytes: 1,662  Cardinality: 2                                          
                                                                    27 NESTED LOOPS OUTER  Cost: 706  Bytes: 1,524  Cardinality: 2                                      
                                                                        24 NESTED LOOPS  Cost: 704  Bytes: 1,316  Cardinality: 2                                
                                                                            21 NESTED LOOPS  Cost: 698  Bytes: 1,124  Cardinality: 2                            
                                                                                18 NESTED LOOPS  Cost: 696  Bytes: 984  Cardinality: 2                          
                                                                                    15 NESTED LOOPS  Cost: 694  Bytes: 892  Cardinality: 2                      
                                                                                        12 NESTED LOOPS  Cost: 692  Bytes: 660  Cardinality: 2                  
                                                                                            9 NESTED LOOPS  Cost: 687  Bytes: 70  Cardinality: 1            
                                                                                                6 NESTED LOOPS  Cost: 5  Bytes: 49  Cardinality: 1          
                                                                                                    4 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_POSTN Cost: 4  Bytes: 37  Cardinality: 1   
                                                                                                        3 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_POSTN_U1 Cost: 3  Cardinality: 1  
                                                                                                    5 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_PARTY_P1 Cost: 1  Bytes: 12  Cardinality: 1     
                                                                                                8 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_OPTY_POSTN Cost: 682  Bytes: 21  Cardinality: 1        
                                                                                                    7 INDEX RANGE SCAN INDEX SIEBEL.S_OPTY_POSTN_M1 Cost: 6  Cardinality: 821   
                                                                                            11 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_REVN Cost: 5  Bytes: 260  Cardinality: 1              
                                                                                                10 INDEX RANGE SCAN INDEX SIEBEL.S_REVN_F3 Cost: 2  Cardinality: 6          
                                                                                        14 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_PROD_LN Cost: 1  Bytes: 116  Cardinality: 1               
                                                                                            13 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_LN_P1 Cost: 0  Cardinality: 1             
                                                                                    17 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_USER Cost: 1  Bytes: 46  Cardinality: 1                   
                                                                                        16 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_USER_U2 Cost: 0  Cardinality: 1                
                                                                                20 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_POSTN Cost: 1  Bytes: 70  Cardinality: 1                          
                                                                                    19 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_POSTN_U2 Cost: 0  Cardinality: 1                   
                                                                            23 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_REVN_X Cost: 3  Bytes: 96  Cardinality: 1                             
                                                                                22 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_REVN_X_U1 Cost: 2  Cardinality: 1                       
                                                                        26 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_PROD_INT Cost: 2  Bytes: 104  Cardinality: 1                                  
                                                                            25 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_INT_P1 Cost: 1  Cardinality: 1                            
                                                                    29 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_PROD_INT Cost: 2  Bytes: 69  Cardinality: 1                                   
                                                                        28 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_PROD_INT_P1 Cost: 1  Cardinality: 1                                
                                                                32 TABLE ACCESS BY GLOBAL INDEX ROWID TABLE SIEBEL.S_OPTY Cost: 2  Bytes: 328  Cardinality: 1  Partition #: 46  Partition access computed by row location                                       
                                                                    31 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_OPTY_P1 Cost: 1  Cardinality: 1                                    
                                                            35 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_SALES_METHOD Cost: 1  Bytes: 318  Cardinality: 3                                              
                                                                34 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_SALES_METHOD_U1 Cost: 2  Cardinality: 1                                         
                                                        38 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_STG Cost: 1  Bytes: 38  Cardinality: 1                                                
                                                            37 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_STG_P1 Cost: 0  Cardinality: 1                                             
                                                    41 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_POSTN Cost: 1  Bytes: 49  Cardinality: 1                                                      
                                                        40 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_POSTN_U2 Cost: 0  Cardinality: 1                                               
                                                44 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_POS_SKILL_IT Cost: 20  Bytes: 2,618  Cardinality: 77                                                          
                                                    43 INDEX RANGE SCAN INDEX SIEBEL.S_POS_SKILL_IT_F2 Cost: 2  Cardinality: 20                                                     
                                        48 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_ORG_EXT Cost: 2  Bytes: 49  Cardinality: 1                                                                
                                            47 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_ORG_EXT_P1 Cost: 1  Cardinality: 1                                                             
                                    51 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_ORG_EXT Cost: 2  Bytes: 46  Cardinality: 1                                                                    
                                        50 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_ORG_EXT_U3 Cost: 1  Cardinality: 1                                                                 
                                54 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_BU Cost: 1  Bytes: 34  Cardinality: 1                                                                         
                                    53 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_BU_P1 Cost: 0  Cardinality: 1                                                                      
                            57 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_ORG_EXT Cost: 2  Bytes: 28  Cardinality: 1                                                                            
                                56 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_ORG_EXT_U3 Cost: 1  Cardinality: 1                                                                         
                        60 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_ORG_EXT Cost: 2  Bytes: 28  Cardinality: 1                                                                                
                            59 INDEX UNIQUE SCAN INDEX (UNIQUE) SIEBEL.S_ORG_EXT_U3 Cost: 1  Cardinality: 1                                                                             
                    63 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_OPTY_POSTN Cost: 4  Bytes: 450  Cardinality: 10                                                                                   
                        62 INDEX RANGE SCAN INDEX (UNIQUE) SIEBEL.S_OPTY_POSTN_U1 Cost: 3  Cardinality: 1                                                                               
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:00:34+00:00Added an answer on May 26, 2026 at 5:00 pm

    The real problem are the following lines:

    8 TABLE ACCESS BY INDEX ROWID TABLE SIEBEL.S_OPTY_POSTN Cost: 682 Bytes: 21 Cardinality: 1 7 INDEX RANGE SCAN INDEX SIEBEL.S_OPTY_POSTN_M1 Cost: 6 Cardinality: 821

    It is responsible for most of the costs, assuming the table/index statistics are up-to-date. Without the actual sql statement the question is why is it more expensive?

    Potential problems:

    • It does a full index range scan is that really necessary or can a more suitable index be created to avoid this.
    • How many rows are actually read by the index scan.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`m having trouble trying to optimize this query with OVER (PARTITION BY ...) because
I am trying to optimize one part of my code that inserts data into
I'm having trouble trying to optimize the following query for sql server 2005. Does
I'm looking for a way to optimize one SQL query that I have. I'm
After putting some code to work, I'm trying to optimize it. One thing that
I'm trying to make a select statement that joins results from three in-line table
I am trying to optimize some stored procedures on a SQL Server 2000 database
I'm trying to optimize the size of my Delphi classes so that they take
I'm trying to optimize SQL queries in Akonadi and came across the following problem
I'm trying to optimize SEO readability on our websites and one issue I've come

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.