Why do these insert vary so much in performance?

I have a table and a package similar to those shown in below DDL.
Table TABLE1 is populated in chunks of 10000 records from a remote database, thru TABLE1_PKG
by receiving arrays of data for three of its fields and a scalar value for a set identifier
in column named NUMBER_COLUMN_3.
I have two databases with following record count in the table:
     DATABASE1: 55862629
     DATABASE2: 64225247
When I executed the procedure to move 50000 records to each of the two databases, it took 20 seconds to
populate DATABASE1 and it took 150 seconds to populate DATABASE2.  Network was discarded as I recorded
in the package how long each of the 5 10000 chunk took to insert in each of the two databases as follows:
Records Being Inserted  Time it took in DATABASE1     Time it took in DATABASE2
First  10000             3 seconds                    27 seconds
Second 10000             4 seconds                    26 seconds
Third  10000             6 seconds                    40 seconds
Fourth 10000             4 seconds                    31 seconds
Fifth  10000             4 seconds                    26 seconds
When I look at the explain plan in both databases I see following:
| Id  | Operation                | Name | Cost  |
|   0 | INSERT STATEMENT         |      |     1 |
|   1 |  LOAD TABLE CONVENTIONAL |      |       |
My questions:
     1) Does the explain plan indicate that Direct Load was not used.
     2) If the answer to 1 is Yes, is it possible to use Direct Load or a faster insert method in this case?
     3) Any ideas what could be causing the 7.5 to 1 difference between the two databases.
Please note that these two databases are non production so load is negligible.
CREATE TABLE TABLE1
  TABLE1_ID                VARCHAR2(255)   NOT NULL,
  NUMBER_COLUMN_1          NUMBER,
  NUMBER_COLUMN_2          NUMBER,
  NUMBER_COLUMN_3          NUMBER
ALTER TABLE TABLE1 ADD CONSTRAINT TABLE1_PK PRIMARY KEY (TABLE1_ID);
CREATE INDEX NUMBER_COLUMN_3_IX ON TABLE1(NUMBER_COLUMN_3);
CREATE OR REPLACE PACKAGE TABLE1_PKG IS
  TYPE VARCHAR2_ARRAY      IS TABLE OF VARCHAR2(4000);
  TYPE NUMBER_ARRAY        IS TABLE OF NUMBER;
  TYPE DATE_ARRAY          IS TABLE OF DATE;
  PROCEDURE Insert_Table1
    Table1_Id_Array_In         TABLE1_PKG.VARCHAR2_ARRAY,
    Number_Column1_Array_In    TABLE1_PKG.NUMBER_ARRAY,
    Number_Column2_In          TABLE1_PKG.NUMBER_ARRAY,
    NUMBER_COLUMN_3_In         NUMBER
END;
CREATE OR REPLACE PACKAGE BODY TABLE1_PKG IS
  PROCEDURE Insert_Table1
    Table1_Id_Array_In         TABLE1_PKG.VARCHAR2_ARRAY,
    Number_Column1_Array_In    TABLE1_PKG.NUMBER_ARRAY,
    Number_Column2_In          TABLE1_PKG.NUMBER_ARRAY,
    NUMBER_COLUMN_3_In         NUMBER
  IS
  BEGIN
    FORALL I IN 1..Table1_Id_Array_In.Count
      INSERT /*+ APPEND */ INTO TABLE1 (TABLE1_ID            , NUMBER_COLUMN_1           , NUMBER_COLUMN_2     , NUMBER_COLUMN_3   )
      VALUES                           (Table1_Id_Array_In(I), Number_Column1_Array_In(I), Number_Column2_In(I), NUMBER_COLUMN_3_In);
  END Insert_Account_Keys;
END;
Thanks,
Thomas

I found answer for why Direct Path is not used when I do an insert into TABLE1@SOMEDATABASE SELECT....:
  http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9014.htm#i2163698
Direct-path INSERT is subject to a number of restrictions. If any of these
restrictions is violated, then Oracle Database executes conventional INSERT serially
without returning any message, unless otherwise noted:
You can have multiple direct-path INSERT
Queries that access the same table, partition, or index are allowed before the direct-path INSERT
If any serial or parallel statement attempts to access a table that has already been modified by a direct-path INSERT
The target table cannot be of a cluster.
The target table cannot contain object type columns.
Direct-pathINSERT
Direct-pathINSERTAPPENDAPPEND_VALUESINSERT
The target table cannot have any triggers or referential integrity constraints defined on it.
The target table cannot be replicated.
A transaction containing a direct-path INSERT
My table is being replicated and I am try it via a distributed transaction.
I am still puzzled as to why it took 2 minutes and 44 seconds to insert 10000 rows in our production database but that's something that I'll investigate if time permits.  For now I've rewritten the process to use Insert...select if the number of records in the batch is less than or equal to a configured (currently set at 400000) number, else it will move using chunck and for now using bulk collect in the source pass arrays of data and FORALL inserts in the target.  If time allows in the future I will try to rewrite to use chunking combinde with insert..select.
Thanks to all for your help,
Thomas

Similar Messages

  • Why do these forums Drop so much?

    I have only been here for a few days but it happens everyday.
    Message was edited by: kenm2474

    I have only been here for a few days
    Part of it, I think, has to do with the influx of new posters/questions with the iPhone 3GS and the 3.0 update--bigger load on the servers. I remember when 2.0 came out and the servers were overloaded, they deliberately dropped Discussions features like search and standings to lighten the load, and I think also closed them at points.
    It certainly wasn't happening before 3.0 came out.

  • RE: Why cd burn times vary so much.

    When burning songs to cd in itunes at 8x most take about 8 min. Occasionally this time spikes to 17 min for no apparent reason. Any ideas as to the cause are appreciated.

    Jeffrey Jones2 wrote:
    An incremental backup only copies files that have changed, or are new, since the last backup. So if only one song was added to the iTunes library, only that song would be copied, not the whole library. On the other hand, if you have, say, a week's worth of new mail, the Mail folder might take a long time.
    In fact, it would be a few weeks. But even where many songs have been added to iTunes, it has never taken more than 11 or 12 minutes to update, yet each song would be 3MB minimum; most email messages are just a few KB. So it can't be actual copying time?
    Incidentally, I had to remove iPhoto from the Pictures backup, as it used to take hours stuck on that one thing alone.

  • How to find lock and more information why the conc prg taking to much time

    Oracle Apps R12- Orader Management
    Hi All
    I am new to Oracle Apps,We i run my concurrent Program
    its take too much time to complete.How to find that there is any lock occur in table while the concurrent program is running, any other way to find why the concurrent program takes too much of time to execute and how can we speed up the process.
    Yesterday day we makes some change to speed up the process with our DBA to speed up the concurrent program
    The first concurrent program takes 2.30 hours and after these changes its take 1.45 hours.Please suggest it is correct
    Logged with System Administrator Responsibility.
    Manager – Define – Standard Manager.
    Set the PROCESSES value as 15 (changed from 10).
    Set the SLEEP SECONDS value as 10 (Changed from 30).
    Manager – Define – Standard Manager2.
    Set the PROCESSES value as 15 (changed from 10).
    Set the SLEEP SECONDS value as 10 (Changed from 60).
    Any suggestion on how find why it takes too much of time.
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    Hi;
    Please check below notes:
    FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]
    FAQ - How to Use Debug Tools and Scripts for the APS Suite [ID 245974.1]
    Turning Debug Mode On [ID 148140.1]
    How to Obtain Debug Log in R12 [ID 787727.1]
    How to enable and retrieve debug log messages [ID 433199.1]
    Running a Trace on a Form [ID 148143.1]
    Running a Trace on a Process [ID 148145.1]
    Regard
    Helios

  • HT4539 I don't know why all these charges are accruing on my iPad i have like 250.00 charged and I have no reason for this to occur! Can you tell me what was purchased or what caused these charges!

    I don't know why all these charges are occurring! Can you please tell me what is costing me so much money?

    iTunes Store & Mac App Store: Seeing your purchase history and ...

  • How to execute these insert statements as a batch?

    Hello,
    I have these three insert sql statements which execute individually. I want to execute them as a batch:
    sql = "Insert into FirstTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement = connection.prepareStatement(sql);
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    insertStatement.executeUpdate();
    sql = "Insert into SecondTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement = connection.prepareStatement(sql);
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    insertStatement.executeUpdate();
    sql = "Insert into ThirdTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement = connection.prepareStatement(sql);
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    insertStatement.executeUpdate();
    I tried the following method, but something is wrong. Can somebody help with executing these inserts as a batch?
    stmt = connection.createStatement(); // connection pool
    sql = "Insert into FirstTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    stmt.addBatch(sql);
    sql = "Insert into SecondTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    stmt.addBatch(sql);
    sql = "Insert into ThirdTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    stmt.addBatch(sql);
    stmt.executeBatch();
    Thank you,
    Logan

    Errr I can't for the life of me understand why you thought that would work. I am bit concerned about how you assembled this code... did you copy and paste and hope for the best?
    It should be.....
    1) Get a preparedStatement using your sql. Do this step once.
    2) For each query you want to batch.... set each of the parameters and call addBatch. Call all this on the prepared statement.
    3) Then call executeBatch on the prepared statement.
    You do not need the other vanilla statement for anything.
    One important thing to note. When you batch parameters for batch prepared statement execution you can only (hopefully obviously) batch for the same SQL query. You can't do one insert and another update in the same query. It has to be all the same query.. just different parameters. This won't effect what you are doing in the above but sometimes it confuses people and they get into trouble later so I thought I would mention it now.

  • Why does signal strength vary on my Westell 327W?

    My wife uses her laptop about 40 feet away from our router, in our house (conventional wood construction, no wireless devices or wireless phones in use in the house, in the suburbs). 
    Her signal strength varies during the day from low to very good--sometimes going from 1 to the other in one minute.  I'm in the 'burbs, and there are not a lot of houses near mine.  Can someone tell me why her signal strength should vary so much, and what I can do about it?

    No, hmm...
    #1
    MrCurious2 wrote:
    with nothing else going on in the vicinity. 
    Not even other radios (Like police officers, fire fighters, medial personal) in the area in use?
    #2 What Firmware is it running?
    If you have no idea of what I mean, take a screen shot of least the first screen that you see in the router - and post it.
    For Windows, this means:
    Pressing the "Print Screen" key on your keyboard, going to paint (Start--->All Programs--->Accesories--->Paint), pressing CTRL and P at the same time, saving the file as a JPEG (use "save as type" as need be), uploading it some where (I use tinypic.com - unless a message board allows uploading the image directly), and giving out the URL of the image..
    ^^
    If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the "Kudos" button.

  • WHY do these discussions not

    Why do these discussions not show # of views and replies anymore? I mean, why remove that info from the page?
    And why make the discussions overall less functional and rather icky..?
    WHY WHY WHY?

    I can't even EDIT my question which i just posted above.
    And the discussions are MUCH slower now on my computer. Very difficult to use. (Is this by design perhaps..?)
    And when I try to "Reply"--i get an error message in a pink box saying
      "An error occurred while trying to submit your post. Please try again."
    That would be an error by the Apple programmers, i guess. At least i can go to the "advanced editor" (a small, grey link in the corner) and submit the reply, but that in itself is absurd. And the "Advanced" editor forces a text box width of nearly 1024, meaning it MUST go off my screen on one side. Pathetic. This is stuff that programmers figured out how to avoid in the 1970s. Hello, Apple.

  • I do not have many messages but my iphone 5s says messages take up 4.6GB of space.  When comparing with friends who have many more message, less than 1 GB is being used on their phones.  Why are mine taking up so much space and how do I correct that?

    I do not have that many messages on my new iPhone 5s (maybe about 15 conversations and only one or two going back a little ways) yet when I go to Settings, Usage it shows that my messages are taking up 4.6GB of space.  When comparing with others (some who have hundeds of messages) they are using under 1GB for their messages.  Why are mine taking up so much space??

    I found a post with this solution that worked for me - .Do a backup, then download ibackupbot. It lets you look into the contents of that backup. Look in system files>mediadomain>library>sms>attachments. I found a ton of huge files related to long deleted texts. ibackupbot let me delete all that old crap. I then restored the phone with that now modifec backup and Bingo! freed up 9 GB. No problems.
    But note, if you are not technically inclined you probaly don't want to be digging around and deleting back up files. You delete the wrong thing and you could jack up your phone badly. Be careful.

  • Why are Windows 'APP's so much harder to code than a Windows Forms application?

    For example I have been smashing my head against a wall trying to save an image file from a share target, the best help I can find is the below code:
    https://social.msdn.microsoft.com/Forums/en-US/65a61679-0da8-4109-8a69-b918be351dfa/how-to-save-a-bitmap-image-from-a-share-target?forum=winappswithcsharp&prof=required
    But in a 'normal' application I can do what I need to do with:
    using System;
    using System.Drawing;
    namespace Project1
    class Class1
    static void Main()
    Image photo = Image.FromFile("C:\\Temp\\oldphoto.png");
    photo.Save("C:\\Temp\\newphoto.png");
    Why do the APPs take so much more code to do something like save a file to disk?
    Mediocre Access 2010 | (Baby) Beginner C Sharp | OK at Active Directory (2012) | Fragmented understanding of DNS/DHCP | Laughable experience with Group Policy | Expert question asker on MSDN Forums

    It is a good question!
    If you need 100 lines of code to save an image it is like a Java program:
    - complicated
    - not fun to develop with
    I think the main problem is that Microsoft release 2 new libraries each year. On the most cases, if you try to compile it with an old library it works, but the app crashes with unexpected errors. It is always harder to develop for Windows and there
    are always more libraries to use.
    So it begun to be normal, to find a W8-store-app-library and use it in Silverlight, to add missing functionality.
    It is a jungle and it seems that Microsoft too doesn't know anymore what library should be in the msdn-help. Some times, if you search for something, you finish on a library that can't be added to your project.
    This is the reason, because your question will probably never be answered!

  • Why is the Insert Panel Missing from Dw CS6 Build 12 v 5861?

    Why is the Insert Panel Missing from Dw CS6 Build 12 v 5861?

    If Nancy's advice doesn't make it pop up as a window, you may have it set as a tool bar, in which case, hitting Ctrl+F2 will make the tool bar appear/disappear.
    To turn it back into a floating panel, click and drag the dashed line on the far left of the Insert tool bar and pull it away from the top. You can leave it as free floating or drag it to another edge until it highlights the edge and drop it to dock it to whichever side of the screen you prefer.

  • What is "Other" and why does it take up so much space?

    What is "Other" and why does it take up so much space?

    What is the Other on my iPhone and How to Remove It
    An "other" larger than about 1 1/2 GB usually indicates that the "other" includes corrupted files.
    First try:
    "First you go settings/general/usage/music/then left swipe over music and press delete and you would think it deletes your music but it doesn't instead it deletes your other but make sure your ipod is connected to a computer while doing this"
    as recommended by:
    How do I get rid of "other" storage: Apple Support Communities
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up

  • Why do photos take up so much space on my phone?

    I have an iPhone 5, 16 gigs. I have 174 photos and 22 videos and it says that the photos take up 3.6g of my memory... My friend has over 2k photos and hers is at 4gigs. I saved my photos to iPhoto and I deleted all my photos and ran a test, I made sure photos were at 0gigs; Then i took 30 random photos and checked and it said that it took up 124mbs. 30 photos 124mbs. I don't understand why my photos take up so much space. I also bought the Beyonce album when it came out and thats the only music I bought and it says it takes up 1.1gigs and the 17 videos are at 974 mbs. help????

    Import the photos to your computer, then sync them back with iTunes. The photos will be reduced in size and quality to fit on the iPhone without taking as much space as the original pictures.
    Also make sure not to use HDR mode if you do not need that feature.
    After you import your photos from Camera Roll or Saved Photos, you can use iTunes to sync them back to your device.
    copied from iOS: Improve backup and restore times by importing Camera Roll or Saved Photos

  • Why wont these free plug-ins/filter show up in Final Cut Pro X?

    Why wont these free plug-ins/filter show up in Final Cut Pro X? Two of them are .fcfcc files from http://pistolerapost.com/pluginz/index.html

    Here are many good effects http://www.fcp.co/forum/9-free-fcpx-plugins-and-templates

  • Why are these Webservices not supported in VC ?

    Hi all,
    I am using NW04s SP9, and I plan to make MDM-Application with VC.
    Therefore I introduced MDM-WebService into NW and defined it on VC.
    but "searchRecords" of "MDMSearchRecords" was displayed with "Not supported"
    in the right frame .
    Mmm...
    So I decided to think from a beginning.
    [http://www.27seconds.com/Holidays/US/USHolidayService.asmx?wsdl|http://www.27seconds.com/Holidays/US/USHolidayService.asmx?wsdl]
    I defined above it on VC and I used "Getholidaydate" .
    Good! .
    However,,, "Getholidaysforyear" was also "Not supported".
    Why are these methods "Not supported" ? .
    and how will come to be usable these methods in VC? .
    Thanx in advance.
    Regards,
    k.sugimoto.

    Hi
    Visual Composer supports Web services that are compliant with the Basic Profile 1 standard of the Web Services Interoperability (WS-I) Organization (http://help.sap.com/saphelp_nw70/helpdata/en/e0/92583ab4da4b9cb524f61ba4267d25/content.htm)
    Best regards
    Vincenzo

Maybe you are looking for

  • Trouble with focus, swing & keyListener

    can anybody out there help me with this problem, I got stuck with: I create a JDialog in a JFrame & would like to add Keylistener to the JDialog as soon as it opens..........but the it doesn't seem to be working....

  • How do I backup my MacBook Pro when the disk image is grayed out?

    I have a MacBook Pro (15 inc. four years old) running OSX 10.6.8 and last night I got the color pinwheel of death.  I could not force quit anything and had to manually power down. When I powered back up I got the folder with the question mark.  I ran

  • Difference between Business Analyst SAP SD and SAP SD consultant

    Hi friends I need openion about what is difference between Business Analyst SAP SD and SAP SD consultant. Raj

  • Feedback  in KM

    Hi, ALL This is  EP 701  KM Repository manager - CM Repository Security Manager:   ACLSecuritymanager I have a problem with  setting permitions users in  (Collaboration ->feedback). There are two users : user1 and user2. There is a  document. User1 

  • Click and something appears on the screen

    what i am trying to do is this, have people click on a link on my website, then have something appear when they click on it. to give you an example, if you go to atticus clothing's website and look under where it says updated news, or something like