[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

performance tunning sql insert - challenging one

Posted on 2016-10-07
2
Medium Priority
?
58 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 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

656 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