Skip to Content

Can we use Begin Parallel Execution to insert into the same table

Can we use Begin Parallel Execution to insert into the same table where I'm passing a different parameter in the where condition everytime.

Add a comment
10|10000 characters needed characters exceeded

  • An insert does not have a where condition. So what do you require in detail (and what is not answered by the official help)?

  • Florian Pfeffer

    I have a procedure which stores the output of one query in a variable say

    t_rst = select columns 
    From big_table left outer
    Small_table
    Where
    Some conditions;

    And then

     insert into table A
    Select * from t_rst;

    This takes a lot of time.

    I want to implement something like.

    I want to range partition the big_table on a column name region.

    And then parallely execute

    Insert into table A
    Select * from :t_rst1 (which contains say partition where region =1)
    Insert into table A
    Select * from :t_rst2 (which contains say partition where region =2)
    Insert into table A
    Select * from :t_rst3 (which contains say partition where region =3)

    So this may parallely insert the data in my Table A.

    This is just a hypothetical example. I don't know if this is feasible or not.

    Any guidance on the same ?

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 24, 2019 at 07:51 PM

    No that is not possible until know. Please check the limitations for explicit parallel executions in the official documentation.

    ... Updating the same table in different statements is not allowed ...

    Add a comment
    10|10000 characters needed characters exceeded

    • Thankyou for your quick help.

      I have a few more doubts:

      Updating the same table includes insert statement too ?

      What if we are inserting into the different partitions of the same table ?

      (Suppose my Table A is also partitioned)

      Is it possible to insert into a particular partition ?

      Something like insert into Table A (partition 1)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.