Solved

performance tunning sql insert - challenging one

Posted on 2016-10-07
2
47 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example, show how to take different types of Oracle backups using RMAN.
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

749 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