Home » SQL & PL/SQL » SQL & PL/SQL » insert versus merge (Oracle 9.2)
insert versus merge [message #427291] Wed, 21 October 2009 15:33 Go to next message
goo321
Messages: 28
Registered: June 2008
Location: houston
Junior Member
In the code I maintain the standard way to load data seems to be
see if the target table contains any rows. Do an insert if empty and a merge if there is some data in target table.

In the interests of less code, I was just curious if there were cases where an insert onto an empty partition/table was quicker than a merge.

From 100,000 records to 50 million.

I realized I could test this myself, but I am lazy.

Thanks,
goo.
Re: insert versus merge [message #427293 is a reply to message #427291] Wed, 21 October 2009 15:43 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
In my opinion, Merge statement is nothing but a combination of Insert and Update/delete
Inserting data into a an empty table should be faster . You can use DIRECT LOAD insert

[Updated on: Wed, 21 October 2009 15:44]

Report message to a moderator

Re: insert versus merge [message #427295 is a reply to message #427293] Wed, 21 October 2009 15:47 Go to previous message
goo321
Messages: 28
Registered: June 2008
Location: houston
Junior Member
Thanks.

Either case would be insert /*+ append */
or merge /*+ append */
Previous Topic: BULK Collect Inside FOR LOOP?
Next Topic: Struck in Loop (merged)
Goto Forum:
  


Current Time: Fri Dec 09 13:48:58 CST 2016

Total time taken to generate the page: 0.16147 seconds