DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Adding INSERT statement to SELECT statement changes execution plan

  1. #1
    Join Date
    Dec 2011
    Posts
    3

    Adding INSERT statement to SELECT statement changes execution plan

    We have a query based on few tables and views.
    When we run "SELECT" statement, this query goes for Nested Loop based Execution plan and finishes off very quickly.
    However, when we add INSERT statement to this "SELECT" statement goes for HASH join based execution Plan. Any help highly appreciated.

    The database being used is 10g R 2.

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Talking

    An INSERT needs to optimize the update off ALL the indexes also.
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  3. #3
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598
    Hi,

    How many records are you trying to load? What is the time difference in both the approach?

    Why not use a USE_NL HINT to achieve this?
    OR Use a BULK LOAD using FOR ALL statement?

    Kind Regards,
    Cheers!
    OraKid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width