Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

performance tunning sql insert - challenging one

Posted on 2016-10-07
2
Medium Priority
?
60 Views
Last Modified: 2016-10-07
I have an insert statement which is  used to insert around 9 million records, I want your guidance in tunning this process. Which is better a plsql procedure or insert statement

INSERT /* + append */ into consumer
Select *
from tmp_consumers  b
where  not exists (select 1 from consumerdata c
                                where c.prodcode=b.prodcode
                                and c.city=b.city)
0
Comment
Question by:sam_2012
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 41834346
sql statement alone is better.

using pl/sql  you'll have to the same sql to perform the insert and select, but on top of that, you have the pl/sql overhead itself.

thing about it this way - you can perform step A, or you can perform step A + step B
No matter how small B is (unless 0, which is impossible) A alone will always be faster.


as a side note - please don't tag the questions "challenging" it's just extra characters that don't really add value in describing the problem.
0
 

Author Closing Comment

by:sam_2012
ID: 41834433
awesome.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question