Insert + Update code in 11g taking WAY longer than 9 ?

Hi guys
Hoping to get a few suggestions as to what might be causing a problem I'm having.
I've got a routine in a form that was previously running against a version 9 database, and is now running against an 11g database.
The routine has a series of cursor loops which results in a number of inserts and updates on the database.
I have in this routine a call to a procedure which inserts a record into a logging table, with the time it is called. With this I can gauge how long the routine is taking.
On the version 9 database, the log of inserts is as follows :
After x rows, time taken (mins, secs)
1000 rows - 1.04
4000 rows - 4.38
9000 rows - 9.43
13000 rows - 14.01
18000 rows - 15.58
So, as a very approximate value, 1000 rows a minute consistantly through to the end at 18000.
The version 11 database is an import of the version 9 database. so has all the same constraints, indexes, triggers etc.
The code disables foreign key constraints before executing, it doesnt drop the indexes.
On the version 11 database, the log of inserts is as follows :
1000 rows - 0.30
4000 rows - 3.58
9000 rows - 19.58
13000 rows - 41.46
18000 rows - 80.45
So rather than staying at a rough 1000 rows per 1 minute time, as more rows are inserted, the time to complete is going up and up and up.
This would point at indexing maybe? But since there is only 1 index on the tables being inserted into, which is the same on the 9 and 11 database, this ought not to be the case.
Can anyone suggest why the version 11 database is taking so much longer, and why the time to process is increasing rather than staying constant throughout.
I'm at a loss at what to look for now.
Thanks a lot
Scott

Scott Hillier wrote:
The code has to gather data from several tables, perform some fairly complex logic on it, building up record structures before inserting into a number of tables and updating several others. None of which can be done with a simple merge statement.
It has to be done using cursors, both implicit and explicit to retrieve the data first."Has to" is a bit presumptive. SQL has got very powerful constructs and features that can (pretty much) do anything you require. It may be complex SQL but it will process all the rows of data in one go rather than doing continuous context switching.
Here's a basic example of the time difference between running stuff as a single SQL and context switching...
[code]
SQL> ed
Wrote file afiedt.buf
  1  declare
  2    v_sysdate DATE;
  3  begin
  4    v_sysdate := SYSDATE;
  5    INSERT INTO mytable SELECT rownum FROM DUAL CONNECT BY ROWNUM <= 1000000;
  6    DBMS_OUTPUT.PUT_LINE('Single Transaction: Time Taken: '||ROUND(((SYSDATE-v_sysdate)*(24*60*60)),0));
  7    EXECUTE IMMEDIATE 'TRUNCATE TABLE mytable';
  8    v_sysdate := SYSDATE;
  9    FOR i IN 1..1000000
10    LOOP
11      INSERT INTO mytable (x) VALUES (i);
12    END LOOP;
13    DBMS_OUTPUT.PUT_LINE('Multi Transaction: Time Taken: '||ROUND(((SYSDATE-v_sysdate)*(24*60*60)),0));
14    EXECUTE IMMEDIATE 'TRUNCATE TABLE mytable';
15* end;
SQL> /
Single Transaction: Time Taken: 1
Multi Transaction: Time Taken: 37
PL/SQL procedure successfully completed.
SQL>
[/code]One hell of a difference, and it can get worse depending on how many switches are done in a loop.
Theres no commit until the end.That's good.
So, feel free to suggest how I go about gathering data to build up the various records without using cursors.Without knowing your structures, data, requirements etc. how can we tell, apart from to say that maximising SQL and minimising PL/SQL will improve performance.
Even if you do - it still wouldnt explain why tuned code which runs in 18 minutes on one box is running at 90 minutes on another.It could be a configuration factor of the database, but equally it could be a number of other factors.
Unless you provide comparative explain plans for queries etc. then how can we tell.

Similar Messages

  • FCP Export Taking WAY LONGER Than Usual.

    Hi there, I've been using Final Cut Pro to edit video from a 1080p Canon Camcorder for the past 10 months, and since last week, whenever I'm done with the editing process and I decide to export the Video in 720p HD with H264 with AAC Audio, the exports take A LOT LONGER than they took before.
    It can take up to 2 hours to export a short 3 minute video..
    Whereas it USED TO take about only 30 minutes for the same footage before.
    Is there anything I'm forgetting, any setting I've accidentally changed or something?
    Please help me out,
    Thank you.
    (I'm using FINAL CUT PRO 7)

    I still can't figure it out,
    a 3 minute long video which was about 300MBs when exported with QuickTime Conversion from FCP7 is now about 1.25 GBs, I don't remember having changed any settings, I've even tried trashing preferences, but still no luck.
    *An old video that was shot with the same HD Camcorder which was 3 Minute long video I had exported was 257.9 MB & the total bitrate is 11,715 (EXPORTED FILE)*
    *But this file that I'm having size issues with right now is also 3 Minutes long (shot with same camcorder) and the exported file is 1.25 GBs and has a bitrate of 58,693*
    These are the QUICKTIME CONVERSION setting I've always used:
    VIDEO:
    Compression: H.264
    Quality: Best
    Key frame rate: 24
    Frame reordering: yes
    Encoding mode: multi-pass
    Dimensions: 1280x720
    SOUND:
    Format: AAC
    Sample Rate: 44.100 KHZ
    Channels: Stereo (L R)
    Bit Rate: 320 kbps
    I've been using these same settings before and I haven't changed anything, but the file size has tripled on exports.
    *Sequence Settings:*
    QUICKTIME VIDEO SETTINGS:
    APPLE PRORES 422
    Quality 100%
    And btw, I always DO A FULL "RENDER ALL" + "RENDER MIXDOWN" before exporting,
    Is there any settings I must make sure haven't changed???
    What is my problem.

  • I went to back up my iPhone4 and it said there was an update.  So I clicked  on 'update and backup' (or something close to that.)  It took FOREVER...way longer than usual. When it was done, it showed the power cord w/an arrow to iTunes.  ***??

    I went to back up my iPhone4 and it said there was an update.  So I clicked  on 'update and backup' (or something close to that.)  It took FOREVER...way longer than usual. When it was done, it showed the power cord w/an arrow to iTunes.  ***???  I restarted my computer and tried the whole process again and still...the power cord with an arrow to iTunes.  And I know this means I have to go to Apple and get another phone and will lose anything that wasn't backed up. Anyone else have this happen or have a solution so I don't have to do a restore???

    Reboot your computer.
    Disable your antivirus and firewall.
    Connect the phone to a USB port directly on your computer, not to a hub. If your computer is not a laptop and has ports on both front and back use a port on the back.
    If iTunes does not recognize the phone when you connect it see: http://support.apple.com/kb/HT1808
    If it STILL doesn't work open a command window and type:
       netsh winsock reset
    Then try again. (It seems that a recent Microsoft Windows update may have corrupted network settings; this restores them to the factory default).
    BTW, was there an error number associated with the failed update?

  • I am syncing my iPhone now, and step 6 of 6 is taking significantly longer than it usually does. Is there a way to tell how long it will take, or complete the process?

    I am syncing my iPhone now, and step 6 of 6 is taking significantly longer than it usually does. Is there a way to tell how long it will take, or complete the process?

    Warp Stabilising is a two part process.
    Analysis and Stabilising.
    Both have a banner across the Program Monitor during the process ( unless you have turned that off.
    Analysis start automatically on forst application...but you can rock in there and start adjusting the parameters.
    You may need to hit "Analyse" Button again.
    You should see the number of frames and the estimated duration during this process.

  • My iPod was updating to iOS 6 and i shut it off during the update because it was taking too long and now my screen in baby blue i've tried to drain the battery but when i plugged it in to charge the blue screen came back on.I dont know what to do

    My iPod was updating to iOS 6 and i shut it off during the update because it was taking too long and now my screen in baby blue i've tried to drain the battery but when i plugged it in to charge the blue screen came back on.I dont know what to do

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • HT5521 I have a lightning to usb cable which is 2m in length.  Is there any known issues with trying to recharge an iPad 4 with this longer length.  It seems to me it is taking much longer than a 1m cord to recharge.

    I have a lightning to usb cable which is 2m in length.  Is there any known issues with trying to recharge an iPad 4 with this longer length?  It seems to me it is taking much longer than a 1m cord to recharge.

    Axel,
    I'm afraid a new SSD won't be different from your bad USB stick. I had similar issues over USB with both a (no-brand) stick and TWO 64gb Kingston SSDNow's (running Kubuntu 12.04 with Kernel 3.11, ia_64): it all runs exceptionally well (wanna know how it feels like booting in 5 sec?) for a few days - then suddenly you find yourself facing that dreaded (initramfs) prompt. You ask yourself: why? Did I upgrade grub lately? Did I upgrade the Kernel? I don't recall so. Ok, let's fix this... insert favorite live cd, boot, fsck...what???? THOUSANDS of errors??? Hundreds of files and directories corrupted, and the system is unusable - Reinstall everything from scratch onto another drive.
    Rinse and repeat: did this 3 times. Then I found this analysis:
    http://lkcl.net/reports/ssd_analysis.html
    I also suspect USB power interrupts more abruptly than SATA power, at shutdown - basically aggravating any power interruption damages. So now I'm going to:
    - buy an Intel S3500!
    - add commit=1 to my mount options in /etc/fstab
    - edit shutdown procedure to add a 5-10 sec pause after unmounting drives.
    Just my two cents.
    Andrea
    Last edited by andreius (2013-12-29 16:51:04)

  • I moved my music from the c drive to the d drive. All of my music is in itunes but my ipod won't sync with itunes. The syncing process is taking much longer than usual too. I left my ipod over night to sync and it didnt finish. Fails to sync every time.

    I moved my music from the c drive to the d drive. All of my music is in itunes but my ipod won't sync with itunes. The syncing process is taking much longer than usual too. I left my ipod over night to sync and it didnt finish. Fails to sync every time. I tried to restore my ipod and it didnt help.

    Ignore.  I figured it out:)

  • Update of latest ios taking a long time

    I have the first ipad and am doing the update to the latest ios version through a PC.  I am trying to install the download; however, it is taking a long time (more than an hour) and seems to be stuck on the backing up stage.  I'm afraid to stop it because it took me five times already just to download the update (over an hour long each) before I realized that I needed to turn off my antivirus to have it download successfully.  Now that it's stuck trying to do the actual update, do I try to stop it and start over or should I just let it run?  Is there something else I should be turning off to have this run more quickly or successfully?

    I finally decided to stop the install because it didn't appear to have any activity in the CPU.  After doing this, it had trouble stopping as well and I had to force a shut down of iTunes.  Then I had issues trying to rerun the install because it would tell me that it was having trouble starting a session for the backup.  To resolve this, I deleted all the backups in iTunes and had to restart my iPad.  After restarting, I was able to do a normal, manual backup of the iPad, so I then tried running the installation again and was successful.

  • Installing updates on macbook.. taking TOO long

    hi, i have just did a system restore on my macbook which was fine, but now that i am updating the software it is taking hours to get past a bar of progress. it is 'installing' 3 items, itunes OS X 5.8 and something else. is this normal that it is taking this long? i don't remember it ever taking this long when i first got the computer.

    hi. i have 2 computers and forgot to change the 'OS' on here.
    it's the 10.5. but i think i have solved the problem. i took the update out of library and just re downloaded it. it seems to have worked.

  • Ipod updater 2006-03-23 taking so long to load

    heeeeeelp. i've had my new ipod for over a month now and it's taking forever to set up. i have most of my music on the ipod but every time i plug it in to my computer to update it prompts me to install the lastest version of itunes and i go through the install wizard every time and it leads me to the ipod updater and it takes waaaaay to long to update so i end up rebooting my computer. it's supposedly updating now but it's been over an hour. what can i do? i just want to update my ipod with new music i've saved in itunes!!!!

    http://docs.info.apple.com/article.html?artnum=93716

  • Error in T-Code: IM24 -Position ID is longer than the maximum allowed 24

    Dear All,
    I am trying to generate Investment Program from Org. Unit in T-Code IM24, but system throws error as below:
    Position ID is longer than the maximum allowed 24 characters
    Message no. AP240
    I have created the Organization unit of my own like IT North, IT South, IT West, IT East.
    Guide on the same.
    Regards
    JS

    Hi,
    Thanks for your immediate response.
    I dont want to extend the maximum allowed character.
    And am not able to check from where i need to control the length of my org. unit.
    Regards
    JS

  • Exported sequence way longer than storyline

    A storyline was created which had 41 minutes of footage in it. This was then edited down into a 14 minute long video.
    However, when exported, the video was 41 minutes long.
    There are no stray clips in the storyline, and I am not looking at a compound clip. Nor is there a gap clip adding this length and I am not using PluralEyes at all.
    The storyline does not even extend to the 41 minute mark; the only way to reach this point is to manually stretch a clip to that length.
    I have tried duplicating the project and manually copy and pasting the clips which comprise the sequence into a new project, neither of which has made any difference.
    It appears that Final Cut Pro thinks that the sequence itself is 41 minutes long, regardless of how long the clips inside it are (unless I manually extend a clip to longer than this 41 minute mark)
    I'm using Final Cut Pro 10.0.3 and Mac OS X 10.7.3

    The storyline is a timeline within a project into which footage has been placed to create a sequence. As I understand it, the official name for a timeline in FCP X is 'storyline'.
    There are no compound clips on the storyline.
    Of the 41 minutes originally placed on the storyline, 27 minutes have been removed in the editing process. The footage was of a 41 minute long conference speech, of which 27 minutes was audience discussion, and was therefore cut out. Thus the original story line was 41 minutes long, but the edited sequence on the story line is 14 minutes long.
    The 41 minute long exported video has the edited 14 minute sequence, followed by 27 minutes of plain black. I'm not confusing the Events browser with the storyline. There is a fully-edited sequence which is successfully exported, but with black 'filler' in the exported video, of which no trace can be found on the storyline.
    This is an issue with the representation of the timeline in an exported video, rather than a connection between the event browser and the storyline.
    Thank you for answering and I hope this additional information is of use to you. The key points are that I'm not confused about how storylines work, or about what the event browser is in comparison, but that there is an exporting issue which I can't understand.

  • Datapump: expdp taking considerably longer than exp

    does anyone know why datapump export takes considerably longer than the deprecated exp function of oracle?
    with few schemes datapump is rather fast. the more schemes you have, the longer it takes for datapump to perform an export. the deprecated exp function however remains fast.
    some statistics i've made:
    12 schemes: export takes ~30 seconds
    128 schemes: export takes ~60 seconds
    152 schemes: export takes ~80 seconds
    328 schemes: export takes ~ 5minutes(!)
    after i deleted schemes and reduced the number of schemes to 68, the expdp function became fast again: ~60 seconds.
    does anyone have a hint for me about where i can make performance modifications? oracle describes in its documentation that datapump is faster than the deprecated export and that the deprecated exp function shouldn't be used anymore. currently this isn't true and we are at a big disadvantage now, since we are using datapump.
    the expdp function "hangs" very long with the following logging output:
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    our oracle version: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    Edited by: user8995776 on Dec 18, 2010 8:29 AM

    i want to add: i checked the trace files and it seems like i'm stuck with the same problem like this guy:
    http://www.freelists.org/post/oracle-l/Any-valid-security-concerns-using-Data-Pump-over-conventional-expimp,7
    this query takes very long, it's exactly the same as his:
    >
    select /*+rule*/
    sys_xmlgen(value(ku$), xmlformat.createformat2('TABLE_DATA_T', '7')),
    0, ku$.base_obj.name, ku$.base_obj.owner_name, 'TABLE',
    to_char(ku$.bytes_alloc), to_char(ku$.et_parallel), ku$.fgac,
    ku$.nonscoped_ref, ku$.xmlschemacols, ku$.name, ku$.name, 'TABLE_DATA',
    ku$.part_name, ku$.parttype, ku$.property, ku$.refpar_level,
    ku$.schema_obj.owner_name, ku$.ts_name, ku$.schema_obj.name,
    ku$.trigflag,
    decode(
    ku$.schema_obj.type_num,
    2, decode(
    bitand(ku$.property, 8224),
    8224, 'NESTED PARTITION',
    8192, 'NESTED TABLE',
    'TABLE'
    19, decode(
    bitand(ku$.property, 8224),
    8224, 'NESTED PARTITION',
    'PARTITION'
    20, 'PARTITION',
    'SUBPARTITION'
    to_char(ku$.unload_method), ku$.xmltype_fmts
    from sys.ku$_10_2_table_data_view ku$
    where not bitand(ku$.base_obj.flags, 128) != 0 and
    not(bitand(ku$.base_obj.flags, 16) = 16) and
    ku$.base_obj.obj_num in(
    select *
    from table(DBMS_METADATA.fetch_objnums(100001)))
    >
    and it's the same for me: the more objects, the longer the expdp process takes. the operation finishes eventually.

  • IPod Update 2006-06-28 taking too long

    I'm trying to update my iPod Nano using iPod Updater 2006-06-28 for Windows XP. I clicked on "Update" and waited for a while. I've been waiting for more than 30 minutes now and the update never ends... My iPod displays the message "Do not disconnect" and my computer says that it cannot interrupt the process right now. How long will I have to wait? I'm afraid to disconnect the iPod manually and damage it permanently? What can I do?
    Thanks a lot.
    Pentium III   Windows XP  

    I used Windows task manager to force iPod Updater to close and, after that, I used the feature "Safely remove USB hardware". My iPod restarted automatically and it's working fine now. The iPod system is up-to-date and it's being recognized by Windows XP and iTunes without a problem.

  • IPhone 5.1.1 Update: Quick via iPhone. Way long via iTunes?

    I started to download 5.1.1. via iTunes and the time estimated was over an hour and the file was 300MB (not sure, don't recall).  So, I stopped the download after ten minutes, and went right to the iPhone to download the update.  Both iTunes and iPhone connected via wifi.  The update using the iPhone took five minutes to download and the file was much smaller (50K?).  Why the difference in time?

    The over the air update is incremental so only updates what needs updating, I saw a figure that on some iPhone's the update was about 46mb, the iTunes version I believe downloads the whole new 5.1.1 version of iOS so its much larger nearly 700mb for some iPhone's. Over the air updates work just fine.

Maybe you are looking for