Home > database > A large amount of oracle insert data
A large amount of oracle insert data
Time:09-24
Oracle using stored procedures while gathering data need to query data from the view and inserted into the partition table, probably five views, each data about the data of 1000 w, I use the insert into table (... The select... Insert this way, only 2 to 3 minutes, the second way to use the cursor, batch to read data from the cursor to insert again, Dbms_output. Put_line (' start time: '| | sysdate); The open bras_cur; Loop The fetch bras_cur bulk collect into resource_tab limit 50000; Exit the when resource_tab. Count=0; For I in resource_tab. First.. Resource_tab. Last Loop Insert into XXX this way takes about 15 minutes, Why the first way is better than the second kind of high efficiency, so much for the great god, what situation with insert into the select What the occasion with a second bulk insert Or in this case what can I do to improve efficiency
CodePudding user response:
Limit is set to 1000-5000 or so in forall way below insert into is certainly faster than the first one
CodePudding user response:
Okay, I have a try
CodePudding user response:
For this way, just like others lend you 10000 dollars, and you, still, even a also a dollar, you record, still owe me 9999, also a again, you still owe me 9998,