Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

optimize oracle query

Posted on 2012-12-29
7
Medium Priority
?
451 Views
Last Modified: 2012-12-31
Hello,

How can I optimize the query insert into tr1234566_tmp_calc VALUES
         (:p1,:p2,:p3,:p4,:p5,:p6,:p7,:p8,:p9,:p10,:p11,:p12,:p13,:p14,:p15,:p
         16,:p17)  :
   Recommendation 1: SQL Tuning
   Estimated benefit is .28 active sessions, 10.88% of total activity.
   -------------------------------------------------------------------

         insert into tr1234566_tmp_calc VALUES
         (:p1,:p2,:p3,:p4,:p5,:p6,:p7,:p8,:p9,:p10,:p11,:p12,:p13,:p14,:p15,:p
         16,:p17)
   Rationale
      The SQL spent 98% of its database time on CPU, I/O and Cluster waits.
      This part of database time may be improved by the SQL Tuning Advisor.
   Rationale
      Database time for this SQL was divided as follows: 99% for SQL
      execution, 1% for parsing, 0% for PL/SQL execution and 0% for Java
      execution.
   Rationale
      SQL statement with SQL_ID "f79cfu8cpyg1b" was executed 464908 times and
      had an average elapsed time of 0.0063 seconds.

Thanks

bibi
0
Comment
Question by:bibi92
[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
7 Comments
 
LVL 14

Expert Comment

by:ajexpert
ID: 38729641
Are you purely going by recommendations OR you are really experiencing performance issues with these insert statements?
0
 

Author Comment

by:bibi92
ID: 38729822
by recommendation.
0
 
LVL 23

Expert Comment

by:David
ID: 38730090
Off the top, inserts are commonly optimized with:
add the hint +APPEND so that writes at made at the high-water mark
parallelize the database writers
disable indexes for the load, and rebuild them after the commit
update the table statistics for the cost-based optimizer
find a compromise on how oftern you need to commit vs load on your redo log buffers
with a half-million rows, you are presumably scheduling this to a minimal-impact window (after hours)

As always, your actual results will vary.
0
Independent Software Vendors: 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!

 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 38730197
Usually, inserts like this don't need any special tuning.  But, what is the time period for these half a million rows to be inserted?  What else is going on in the database at the time?  Can you combine these inserts to be multiple row inserts?  If yes, it may make sense to try the "append" hint.  But, there are some disadvantages to this approach.
0
 
LVL 14

Expert Comment

by:ajexpert
ID: 38730205
I suggest just don't follow recommendation unless you experience performance issue.  As suggested by other experts, Inserts do not need special tuning unless millions of records are being inserted.
0
 
LVL 35

Accepted Solution

by:
johnsone earned 1500 total points
ID: 38732408
I take this from you original post:

had an average elapsed time of 0.0063 seconds.

What do you expect to improve?

This is a bound statement and the plan is being repeatedly reused.  I don't see any problem with the statement at all.  It is showing up on a report because it exceeds a threshold, but the reason that it exceeds a threshold is that it has been run so many times.
0
 

Author Closing Comment

by:bibi92
ID: 38733100
Thanks regards bibi
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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 video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

722 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