Solved

performance tunning sql insert - challenging one

Posted on 2016-10-07
2
31 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 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
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
Comment Utility
awesome.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now