Performance Tunning - Could anyone please help

I have a procedure which uses two offensive queries.The currenttime its taking is approximately 2 min in DEV and in PROD 20 min.
Target is to reduce time to less than a minute in DEV and max 5 min in PROD.
PROBLEM1######################### I think nothing much can be done here.
Correct me in case I am wrong.
Insert into TEMP_A ===> Global Temporary table
(col1,
col2,
col3,
col4,
col5,
col6,
col7,
col8,
col9,
col10,
col11,
col12,
col13,
col14)
Select distinct
o.value1
,decode (staticvalue1, 1,o.value2,NULL) ==> Static values are populated from some other table
,decode (staticvalue2,2,o.value2,NULL)
,o.value4
,o.value5
,decode (staticvalue3,1,o.value3,NULL)
,decode (staticvalue4,1,o.value4,NULL)
,decode (staticvalue5,1,o.value5,NULL)
,decode (staticvalue6,1,o.value6,NULL)
,decode (staticvalue7,1,o.value7,NULL)
,e.value1
,e.value2
,e.value3
,e.value4
from table1 o ==> Big table having 100000(1L) records daily transacational table
table2 e==> Big table having 2L records daily transactional table
table3 oe ==> small table of 14000 records
table4 ji ==> Just 500 records
where ji.id= static value==> passed as input to procedure and 1 record is retried for that id
and ji.col1= oe.col1
and oe.TIMESTAMP >=ji.TIMESTAMP
and o.TIMESTAMP < ji.TIMESTAMP+1
and o.orderid =OE.orderid
and e.eventid = oe.eventid
and e.TIMESTAMP >=ji.TIMESTAMP
and e.TIMESTAMP < ji.TIMESTAMP+1
table1 o ==> Indexed with orderid, TIMESTAMP
table2 e ==> Indexed with eventid, TIMESTAMP
After these are fed, a very small manipulation to TEMP_A ==> Global temp table
Then major offensive insert is fired.
By now TEMP_A contains 1500 records.
PROBLEM2######################################################################
Insert into TABLE5
(a,b,c,d,e,f,g,h,i,j,k,l,m)
select
hardcode value1,
hardcode value2,
c.value1
c.value2
c.value3
c.value4
MAX(TRUNC(e.TIMESTAMP))
decode(staticvalue,0,MAX(e.TIMESTAMP)
,1,MIN(e.TIMESTAMP)
SUM(e.value5) as quantity,
SUM(e.value6 * e.val7)/SUM e.value6 as price
decode(staticvalue,0,SUM(e.value5*e.val7)/SUM (e.value6),
1,ROUND(SUM(e.value5*e.val7)/SUM (e.value6), 4),
2,TRUNC(SUM(e.value5*e.val7)/SUM (e.value6), 4)) as consider
SYSDATE
'APP_NAME'
FROM
table1 o ==> Big table having 100000(1L) records daily transacational table(same tables as above)
table2 e==> Big table having 2L records daily transactional table(same tables as above)
table3 oe ==> small table of 14000 records(same tables as above)
table4 ji ==> Just 500 records (same tables as above)
TEMP_A c ( which is the same TEMP table populated earlier)
WHERE
ji.id= static value==> passed as input to procedure and 1 record is retried for that id
and ji.col1= oe.col1
and oe.TIMESTAMP >=ji.TIMESTAMP
and o.TIMESTAMP < ji.TIMESTAMP+1
and o.orderid =OE.orderid
and e.eventid = oe.eventid
and e.TIMESTAMP >=ji.TIMESTAMP
and e.TIMESTAMP < ji.TIMESTAMP+1
GROUP BY
c.value1
c.value2
c.value3
c.value4
The temp_A table is not indexed and its written as CREATE Global temporary ***** on commit preserve rows.
The SQL trace of the second problem as follows.
| Id | Operation | Name | Rows |
Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 |
428 | 30 (7)| 00:00:01 | | |
| 1 | SORT GROUP BY | | 1 |
428 | 30 (7)| 00:00:01 | | |
|* 2 | TABLE ACCESS BY LOCAL INDEX ROWID| table1 | 1 |
18 | 15 (0)| 00:00:01 | | |
| 3 | NESTED LOOPS | | 1 |
428 | 29 (4)| 00:00:01 | | |
|* 4 | HASH JOIN | | 1 |
410 | 14 (8)| 00:00:01 | | |
| 5 | NESTED LOOPS | | 4 |
860 | 8 (0)| 00:00:01 | | |
| 6 | TABLE ACCESS BY INDEX ROWID | table3 | 1 |
16 | 2 (0)| 00:00:01 | | |
|* 7 | INDEX UNIQUE SCAN | PK_table3 | 1 |
| 1 (0)| 00:00:01 | | |
|* 8 | TABLE ACCESS FULL | Table4 | 4 |
796 | 6 (0)| 00:00:01 | | |
| 9 | TABLE ACCESS FULL | TEMP_A | 1648 |
313K| 5 (0)| 00:00:01 | | |
| 10 | PARTITION RANGE ALL | | 1 |
| 14 (0)| 00:00:01 | 1 | 14 |
|* 11 | INDEX RANGE SCAN | PK_table2 | 1 |
| 14 (0)| 00:00:01 |
If other than global temporary table, problem can be resolved, also suggest for the same.

hi ,
perhaps you might want to try the insert into /*+ APPEND */ table_name or using SQL Loader (but i have not used it before though)
What i know of the APPEND hints is it reduces the logging but it should be recommend for inserting records of huge size as it moves pointer above the High-Water-Mark (i.e i think that some spaces will be wasted for those below the HWM)
hope that might help
tks & rgds

Similar Messages

  • I just downloaded the free trial of Adobe PDF to Word converter and was not able to convert a PDF file to word. Could anyone please help? Thx

    I just downloaded the free trial of Adobe PDF to Word converter and was not able to convert a PDF file to word. Could anyone please help? Thx

    Part of the problem in helping is likely that there is no program Adobe -- that is the company name. You are in the Acrobat forum, but it sounds like you have subscribed to Export PDF or such, a different program. The subscription to Acrobat is currently $19.99 per month.

  • I cant see the Video of WMV file through Flip4mac, only audio is working fine on macbook pro. Could anyone please help?

    I cant see the Video of WMV file through Flip4mac, only audio is working fine on macbook pro. Could anyone please help?

    Hi,
    Check to see that external video is turned on.
    View > External Video > All Frames. and
    View > Video Playback > Apple Firewire PAL/NTSC.
    Sandeep

  • Okay so I recently bought an IPhone 4S from a friend, and when I had gotten home, his old iTunes/apple/ICloud account wa still logged in and after a few  attempts of it, I don't know the way through it, could anyone please help?! thank you so much!!

    Okay so I recently bought an IPhone 4S from a friend, and when I had gotten home, his old iTunes/apple/ICloud account wa still logged in and after a few  attempts of it, I don't know the way through it, could anyone please help?! thank you so much!!

    You've encountered iCloud Activation Lock. Contact you friend and have him follow the directions here:
    Find My iPhone Activation Lock: Removing a device from a previous owner’s account

  • I have external hard drive and I cant make changes in it, such as deleting photos or adding photos to external hard drive from macbook pro. could anyone please help me. I don;t know what to do...

    I have macbook pro. I can not make changes in external hard drive such as deleting photos also I can not add photos to external hard drive. could you please help me?

    That's the way.
    The drive is probably formatted NTFS which is Windows proprietary file system. Mac OS can read it, but not write to it.
    You can do as suggested by TheDave if you have sufficient HD space for temporary storage. Depending on whether you need to continue using the drive with Windows machines there are a few options.
    Best for Mac only use is to re-partition and format as GUID partition map and Mac OS Extended (journaled)
    For dual use, Leave the partition as MBR and format as FAT32 (MS-DOS in Disk Utility). This has a file size limit of a little over 4GB, but can be read and written to by both Mac and Windows.
    There is also exFAT (aka FAT64) if both OSs support it - no file limit there that you'll ever reach.
    Alternatively there are software solutions which will allow the Mac to read and write to NTFS drives. I'm told they're not as good as the other solutions, but may be an option if you haven't space to store the contents while re-formatting.

  • Ipad is disables, when I go into itunes to recover it gives me the message "The ipad software update server could not be contacted" could anyone please help me??

    My son has disabled his ipad mini, Ive tried to go into Itunes to recover but i is giving me the following message:
    "The Ipad software update server could not be contacted" could someone please help me I have an upset little boy who thinks the only option left would be to put the Ipad in the bin!!!!!

    Hi there BEXDON,
    You may find the troubleshooting steps in the article below helpful.
    iTunes for Windows: iTunes can't contact the iPhone, iPad, or iPod software update serverhttps://support.apple.com/kb/TS1814
    -Griff W. 

  • My music on iTunes has gone completely wrong. Could anyone please help me?

    Hello everyone. I'll try and keep this as unconvoluted as possible so here goes...
    I have iTunes 10.4.1.10, although the problem started with the previous update. I was trying to sync music from a Top rated playlist to a new iPhone (a 3GS with up-to-date-software) when I noticed that some of the albums which I had previously has on had disappeared. All of  my albums are saved onto an external hard drive, but the album icons were not on the music library. I put the albums back on (and a few new ones) and a message came up saying that the albums/songs were already there and would I like to replace them; I clicked the 'yes' button. I went about giving the songs I wanted in my Top Rated with no problems and went to sync them as normal. This is where it goes wrong.
    iTunes goes through the syncing motions (Steps 1 and 2), reaches Step 3 where it syncs the songs, syncs about 40 of the songs (there are 770 in total) before reaching one of the songs which I had found missing and had put on again. iTunes crashes ( I think that describes it: the 'syncing bar' at the top stays frozen on the song, it will not shut down but everntually stops trying to syns and I can shut it down again; and when I look at the iPod on my iPhone it says cancelling sync and then that it is updating the library before going back to normal).
    This was done on the first attempts, now when I try it syncs one songs before the problem song before going wrong. A thing to note about the song before is that the song that ends up on my ipod isn't the one it said that it was syncing, and the songs do not appear to be added in any sort of order.
    After this I get a message that the song that caused this cannot be found: 'Attempting to copy to the disk "Charlie's iPhone" failed. An unknown error occurred (-69).' Sometimes this is followed by a similar message which says that the song in question cannot be found.
    When I put my hard drive into the computer it says that there may be a problem with some of the files on the hard drive and would I like to scan and fix them, but it does not specify whether those files are music files (there are photo files, Word files, all sorts on it). I haven't given it permission to do so yet, this has not caused problems with previous i-Pods -Phones or Tunes and I don't exactly see how this would affect it now anyway seeing as the files have been re-done (burned off of iTunes and stored on the hard drive directly), but this may help work out the problem.
    A few last things. There is are albums which I definately have NOT put onto iTunes or my hard drive which has appeared on my iTunes music selection and I highly doubt are in the house (Bob Acri's self-titled album containing just song 3 and Fine Music, Vol. 1 by Richard Stoltzman containing the second song), they may have been added onto the computer by another family member and just innocently found their way on iTunes and my hard drive, but they're not the sort of thing anyone in my family would listen to, so maybe that might help someone diagnose the problem too.
    Also, the same thing is happening with my laptop, which has the previous update to the one I mentioned above. This would suggets that its either the new updates fault or the hard drive's fault, I would suspect it would be the former as the laptop too did not have any issues like this, or indeed at all, before the two updates.
    Anyway, thank you for taking the time for reading through, and if anyone could offer any hints or tip or advice to get iTunes back to speed I would be very grateful.
    Thank you!

    Having a similar issue.  Everytime i restart itunes its like its the first time its run and wants to look for music.   Yes, please help!

  • Adobe flash player crashing my whole computer could anyone please help?

    Is this just a win vista problem or something?
    Computer specs:
    Windows Vista™ Home Premium (6.0, Build 6002) Service Pack 2
    Dell XPS430 BIOS: Phoenix ROM BIOS PLUS Version 1.10 A00
       Processor: Intel(R) Core(TM)2 Quad CPU    Q8300  @ 2.50GHz (4 CPUs), ~2.5GHz
                 Memory: 6078MB RAM
              Page File: 1979MB used, 10287MB available
    DirectX Version: DirectX 11
    ATI Radeon HD 3600 Series
       Display Memory: 3031 MB
    Dedicated Memory: 248 MB
        Shared Memory: 2782 MB
         Current Mode: 1280 x 900 (32 bit) (60Hz)
    Everything is up to date explorers, java, direct x, video cards, checked every single driver...
    This is my problem:
    The newest flash player crashes everytime I open certain web pages like failblog or tinychat which requires a webcam
    I'm not sure what is causing it but it's only when i'm on those webpages that it crashes...
    I can go on youtube kongregate steam and I can play tons of games the only thing I cant do is go on certain websites that messes with the newest version of flash for some reason...
    I can use ANY other version of adobe flash and it won't crash at all but the problem with using the older versions is that I can't use my webcam on certain sites.
    Will there be another update release for adobe flash that will fix this problem? The previous version was fine I don't know what was changed but will it get fixed?
    And yes I have also been into the error logs but it doesn't show anything and the codes that it does show, people don't know what the hell it means lol just a bunch of binary number like data...I could post that but I doubt it would be of any help it's just a few short lines of numbers on each crash...I have purposely crashed my computer about 2 times to check if error logs popup and to see what is crashing the flash player but nothing changes in the crash log..
    So to sum my problems up into a short paragraph....newest flash player crashes my computer when I go on webcam/webchat/certain websites with flash videos on it, also if I right click and try to tamper with the settings it also crashes my computer...I would like to know if there's a possible fix for this or will there be another update released anytime soon?
    Please help and thank you for all future responses I will continue to use older versions of flash player till this problem is resolved, also on my newer i-7 620 processor 5850 ati laptop it crashes but rarely although I can use my webcam on msn on that computer but this is one has problems....

    Sorry I wasn't able to respond for a while I work two jobs so I   really don't have time for this although I would still like to get this   solved very much.
    In the event viewer all it says is that there was an unexpected shut down.
    I  have checked and updated everything on both computers I tried to   disable hardware acceleration and that still didn't change anything.
    Sometimes  when I try to just right click on a flash player and change  the  settings it crashes, if I try to load certain pages it crashes, if I   try to use a webcam chat on a webcam site it crashes. Though I can   still view other people's webcams in chat ex: tinychat I could be in   there chatting away with some friends from across country and nothing   will happen until I click webcam and flash player asks to allow, it  will  crash if I try to right click anywhere and that little flash  settings  popup it crashes.
    All of this happens when I use the most  current version of flash  player any other previous version will not  crash when doing any of this  although I can't use my webcam since the  website is running an updated  version which is why I would like to get  this problem fixed.
    The new firefox update didn't help  at all it still just freezes.  There is no blue screen, no crash error  report, no event log. The event  viewer just says it was shut down  unexpectedly.
    I also tried uninstalling all webcam  applications unplugging my  webcam and that didn't affect it at all.  I've done everything that  people have been doing on here to solve there  problems, I used the  search button and tried options from various  threads but none work for  me.
    I can do everything  normally that requires flash player like play  games, watch videos, and  other stuff but it just crashes when I do those  certain things as  stated above. It's weird that there is no log, no  anything just a  freeze and I can't do anything to the computer i've  tried letting it  sit for about 15 minutes but it didn't respond. I used  ctrl alt del  after a while, alt tab, alt f4, holding down certain keys,  holding the  power button in for a while and nothing will happen. It just  sits  frozen untill I unplug it.
    Is there anything I can do to get an error log of the crash since event viewer isn't working?

  • Could anyone please help about print check??

    Dear expert,
    We are testing the print process in  OEM sample company but it did not print out and show that "The print document could not be started?" I have no clue how to solve this problem. The printer can print anything except this check, we are new to SAP and will go live very soon. Please help if you could. Thanks a lot.

    Mickey usually the standard for processing a check in not to use the check for payment area, thats more for manual checks or viewing a check already posted.
    My suggestion is to go to the outgoing payments area and select what you are going to pay using this area, post this..
    then go to the document printing under Banking, change the document type to checks for payment
    select the checks you want to print and enter your starting ck number...
    send this to the printer of choice, wait until all checks print and then confirm
    Hope this helps
    ps also make sure you have the default layout for the check listed in Admin, set up, banks, house banks...scroll to the right and see the defaults to set up.
    Edited by: Joanne Pencola on Sep 28, 2011 1:53 PM

  • TS4006 I lost my iphone 5 in transit, could anyone please help me out in tracing and finding it out? thanx in advance.

    I lost my iphone 5 in transit, and couldnot able to trace it out.  Any help in this regard in bringing back my phone would be appreciated.
    Thanks in advance. please help me out.

    If you activated the Find My iPhone service (in Settings>icloud), and if the device's batteries still have a charge, the device is not turned off and has not been reset and is connected to wifi, then you can try to track it.  Using a computer, log into icloud.com and look at the Find My iPhone page.  On a device, invoke the Find My iPhone app (get it for free at the itunes app store) and log into the icloud account.
    If the device is listed as "offline", then one of the requirements listed above is not met (like being connected to wifi, or if the device was stolen and the thief reset it).

  • Have a Mac Mini 10.7.5-Playing Words With Friends I keep getting an "Oh Snap" message that kicks me off the site.  Was charged $95 for diagnostics and they couldn't recreate the problem.  Could anyone please help?

    Help with Words With Friends Oh Snap notices and my Mac Mini 10.7.5.

    Did Apple charge you $95?
    Run this and post the results here:
    EtreCheck
    Run this and see if you have any malware.
    Adwaremedic: Removes all known adware from your Mac

  • Hello! I tried to get some new personas today, but when I rolled over a design, there's no instant preview anymore... Could anyone please help? Thanks! ^^

    When I first upgraded to firefox 3.6, I could preview any design instantly. Have recently cleaned up junk files using iobit systemcare.

    Previewing a persona only works on sites that are whitelisted via an allow exception.
    Tools > Options > Security : "Warn me when sites try to install add-ons": Exceptions
    Make sure that you do not use [[Clear Recent History]] to clear the 'Site Preferences'.
    See http://kb.mozillazine.org/Themes#Lightweight_theme

  • HT4381 When I try it go into Apple TV it says account sign in failed.  The iTunes Store is currently unavailable. Could anyone please help with this?  Thank you

    Wen I try to go into my Apple TV it says account sign in failed then says the iTunes Store is unavailable. Dos anyone have any any input or solutions for this?  Thank you

    After I upgraded to Mavericks I was also having this message when I tried to update. There was a previous post about this problem which offered this simple solution which worked for me:
    b0n0b0
    Re: Recently upgraded to Maverick from SnowLeopard. Unable to get updates from App store.
    Mar 15, 2014 9:05 AM (in response to Terence Devlin)
    Got it! Thanx.  What I did was go to my account, check that they had my new ID and Password which they did, then hit reset button. All fixed.

  • Could anyone please help! There's no icon for iCloud on my MacBook Pro under System preferences. I 'm not sure if this is connected with my previously asked question re "unknown error" in trying to purchase more storage.

     

    Thanks AnaMusic. I didn't realise that I needed OS X Lion installed on my MacBook Pro. Bought it and installed and the icon is now there Now I'm faced with having to familiarise myself with the new features of OsX Lion and it is truly overwhelming. A step-by-step approach is called for I suppose. Thanks so much for your help

  • I have just updated to iOS 5.1 for iphone 4s. I have problem sending sms or make call. Can anyone please help

    I just updated my iPhone 4s to iOS 5.1. Since the update, I am not able to make calls or send sms. I reset network settings several times but not luck. I have also turned off data and 3G but no luck.
    Could anyone please help me? Right now, my iPhone 4s is use-less.
    thanks
    terryhome

    I have a similar problem...iMessage is not working for me. I can only send SMS and when I try to activate it an error will come up. It won't even let me use my Apple ID.
    Does anyone know how to fix this? I've already tried resetting everything and it just won't work!

Maybe you are looking for