Is there anything that can be done to tune this query?

DB version:10gR2
From AWR report, we have determined that the following SQL is taking most CPU Time. Is there anything that we can do to improve the performance of this query.
We have an index on (stat_code,create_date_time) columns of ext_replenish table.
SELECT EXT_REPLENISH.EXT_REPLENISH_ID, EXT_REPLENISH.EVENT_ID, EXT_REPLENISH.EVENT_KEY, EXT_REPLENISH.WHSE, EXT_REPLENISH.VALIDATE_KEY, EXT_REPLENISH.NBR_OF_RETRY, EXT_REPLENISH.STAT_CODE, EXT_REPLENISH.ERROR_SEQ_NBR, EXT_REPLENISH.CREATE_DATE_TIME, EXT_REPLENISH.MOD_DATE_TIME, EXT_REPLENISH.USER_ID, EXT_REPLENISH.CL_MESSAGE_ID, EXT_REPLENISH.SCHEMA_ID, EXT_REPLENISH.ELS_ACTVTY_CODE, EXT_REPLENISH.CD_MASTER_ID FROM EXT_REPLENISH WHERE ( ( ( ( ( EXT_REPLENISH.STAT_CODE = :1 ) OR ( EXT_REPLENISH.STAT_CODE = :2 ) ) OR ( ( ( EXT_REPLENISH.STAT_CODE = :3 ) AND ( EXT_REPLENISH.ERROR_SEQ_NBR >= :4 ) ) AND ( EXT_REPLENISH.ERROR_SEQ_NBR < :5 ) ) ) AND ( EXT_REPLENISH.MOD_DATE_TIME <= :6 ) ) AND ( EXT_REPLENISH.NBR_OF_RETRY < :7 ) ) AND ROWNUM <= 1 ORDER BY EXT_REPLENISH.STAT_CODE ASC, EXT_REPLENISH.CREATE_DATE_TIME ASC FOR UPDATE
Is there anyway i could tune this query?
note: Ignore the unnecessary brackets. They are system created(apparently by hibernate)
Message was edited by:
Nichols
Taking off the pre tags due to readability issue(all words appear in single line )
Message was edited by:
Nichols

From just blindly looking at this particular query, there doesn't seem any obvious reason why an index couldn't be extended to cover all the columns specified in the where clause.
It might not help too much -> explain plan is required first really before blindly guessing.
Obviously, there's no point having an order by and a rownum (unless you wanted to do the order by before the rownum in an outer select) - I assume this is just a Hibernatism.

Similar Messages

  • My system keeps shutting off unexpectedly after updating it to OS X 10.8.2 (12C60). is there anything that can be done to correct this?

    My system keeps shutting off unexpectedly after updating it to OS X 10.8.2 (12C60). is there anything that can be done to correct this?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output andWi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • I tried to update my macbook pro, the screen is now frozen. My track pad hasn't been working for awhile and my disc drive is broken. IS there anything that can be done without buying a new laptop. It was bought in 2009

    My track pad has not been working properly for awhile and my disc drive it damaged. I went to update my macbook pro to maveric and it is now frozen and not allowing me to click anything. Is there anything that can be done to fix this without buying a new one? Its from early 2009

    ShelbyMackenzieLynne,
    when you say that your disc drive is damaged, do you mean your MacBook Pro’s hard disk drive, or do you mean its SuperDrive (the CD/DVD drive)?
    When you’d updated your MacBook Pro to Mavericks, did the installation succeed, and subsequently freeze up? Or did it freeze up during the Mavericks installation?
    Which version of OS X was installed on your MacBook Pro before you’d installed Mavericks?
    Are you currently able to boot into the Mavericks recovery partition? To see if you can do so, hold down a Command key and the R key while starting up your MacBook Pro.

  • I just lost hundreds of songs due to this new software update...I can't find them anywhere in iTunes! Is there ANYTHING that can be done to restore those songs?!?!

    Please help me figure this out......having NO MUSIC is like ripping off a part of me and throwing it away : (   Just devastating.

    If you have iTunes 10.3 or later and you are a resident of the U.S. you can re download past iTunes purchases for free.
    Click Purchased under Quick Links right side of the iTunes Store window.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • So my phone got wet the other day. I dried it out completely, but the touch screen still isnt working. Is there anything I can do short of getting a new phone? Anything that can be done at the nearest Verizon store? I am one of three phones on our plan an

    So my phone got wet the other day. I dried it out completely, but the touch screen still isn't working. Is there anything I can do short of getting a new phone? Anything that can be done at the nearest Verizon store? I am one of three phones on our plan and I am trying not to need to get a new phone before our contract expires next month.

    Hello wetphone!
    We're sorry to hear that your phone isn't working. It's very important to have a functioning touchscreen!  Let's explore your options OK? If the phone is taken to a store, troubleshooting can indeed be done. The store representative can even contact us while you're there.  Do you have insurance on the device? Or, do you maybe have a prior vzw device that can be activated until the upgrade is available? You can also check your My Verizon account to see if your line( or another line on the account) is eligible for an upgrade. VZW always has options for you.
    Thank You,
    ChristinaB_VZW
    VZW Support
    Follow us on Twitter @VZWSupport

  • I have an iPhone 5 and the camera won't focus. I don't know if there's anything that can be done. Does anyone have any suggestions?

    I have an iPhone 5 and the camera won't focus. I don't know if there's anything that can be done. Does anyone have any suggestions?

    Basic troubleshooting
    reset
    restore with backup
    then as new
    as required if still issues then it is possibly a hardware fault  suggest you take iPhone to an Apple Store genius bar

  • Is there anything that can't be defined with annotations?

    HI,
    Is there anything that can't be defined with annotations and can only be defined in the faces-config.xml?
    Thanks.

    A few more things that cannot be defined in faces-config.xml are:
    - Localization information
    - ELResolver
    - Application Factories
    - Renderers
    - Validators etc.

  • Have a 27 imac desktop with mac osx 10.5.8, finally got out of grey and black screens etc. is there anything I can do to prevent all this from happening again when I shut down?

    Have a 27 imac desktop with mac osx 10.5.8, finally got out of grey and black screens etc. is there anything I can do to prevent all this from happening again when I shut down? Or before I shutdown? TIA.

    Basic Backup
    For some people Time Machine will be more than adequate. Time Machine is part of OS X. There are two components:
    1. A Time Machine preferences panel as part of System Preferences;
    2. A Time Machine application located in the Applications folder. It is
         used to manage backups and to restore backups. Time Machine
         requires a backup drive that is at least twice the capacity of the
         drive being backed up.
    Alternatively, get an external drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
      1. Carbon Copy Cloner
      2. Get Backup
      3. Deja Vu
      4. SuperDuper!
      5. Synk Pro
      6. Tri-Backup
    Visit The XLab FAQs and read the FAQ on backup and restore.  Also read How to Back Up and Restore Your Files. For help with using Time Machine visit Pondini's Time Machine FAQ for help with all things Time Machine.
    Although you can buy a complete external drive system, you can also put one together if you are so inclined.  It's relatively easy and only requires a Phillips head screwdriver (typically.)  You can purchase hard drives separately.  This gives you an opportunity to shop for the best prices on a hard drive of your choice.  Reliable brands include Seagate, Hitachi, Western Digital, Toshiba, and Fujitsu.  You can find reviews and benchmarks on many drives at Storage Review.
    Enclosures for FireWire and USB are readily available.  You can find only FireWire enclosures, only USB enclosures, and enclosures that feature multiple ports.  I would stress getting enclosures that use the Oxford chipsets especially for Firewire drives (911, 921, 922, for example.)  You can find enclosures at places such as;
      1. Cool Drives
      2. OWC
      3. WiebeTech
      4. Firewire Direct
      5. California Drives
      6. NewEgg
    All you need do is remove a case cover, mount the hard drive in the enclosure and connect the cables, then re-attach the case cover.  Usually the only tool required is a small or medium Phillips screwdriver.

  • The FireFox Browser loads itself very slowly and makes me wonder if it is loading at all. Is there something that can be done to speed up the FF Browser loading?

    FF Browser 5 loads itself very slowly and takes so long with no sign that it is loading that many times I will click it again and later find that it has loaded itself twice.
    Is there anything that I can do to speed the start-up of this browser?
    It seems that if there is not a way to load this browser faster that FireFox would make an add on that would show us that the Browser is in process of loading at the very least. Thank you for your kindness in any way for help in this regard. Best Regards
    Sincerely Walt

    cmauze2 wrote:
    Ann154 wrote:
    What happened to your old SIM card?  You should have been able to move that card to the new replacement device.
    [quoted]:
    "Sales clerk asked me if I had a Sims card for it. I told him that there`s one in my old phone. He explained to me that it was not going to be working..."
    Or were you referring to the one in the old temporary replacement device? Would that even be compatible with the newer phones?
    The one that wasn't working had a 4G LTE SIM card in it. It should have usable in the replacement Razr. It was only until I read the OP a third time this morning that there might be a third device involved. It would be nice if people would give more specifics on what devices are active at what time. Then the readers of this community can follow the progression of the events better.

  • After updating my iPhone 3GS to IOS 6.1.3, my iPhone no longer charges by wall or connected to my computer, it doesn't even start itunes, meaning I cannot restore software, anything that can be done without returning the phone?

    I updated the phone, and now, it won't charge through the wall charger, or through connecting to my PC. It doesn't even launch itunes or register it has connected. But the phone still palys music through my docking station. HELP!?

    Hey guy;
    I have the same problem and I do anything you can imagine. If you leave your phone about two or three days and after that plug in it your phone will be power on but your problem doesn't fix. I tried to restore as a new phone, reset all my settings and also I contacted Apple Support but I couldn't fix it. I think that it would be a software issue because it occurred right after iOS 6.1.3 update. It look likes that we have only two choice. First choice is waiting until Apple release next iOS update and check it in our phones, and the other choice is visiting an Apple retail store to diagnostic our phones for hardware issue.

  • Can somebody please simplify/tune this query?

    Hi,
    Can somebody please simplify this query?
    It's a little urgent. Currently this query is taking 10 mins to run.
    Thank you so much,
    vasu
    Purpose:
    First Child Case Ind =
    Get Parent Case for this case.
    Get all child cases for this parent case.
    Arrange them in ascending order by create Date.
    If the first case (eldest case) is the case in question,
    then Y
    else N
    Query:
    SELECT THIS_CASE.OBJID THIS_CASE_OBJID,
    PARENT.PARENT_OBJID,
    (CASE
    WHEN PARENT.FIRST_CHILD_OBJID = THIS_CASE.OBJID
    THEN 'Y'
    ELSE 'N'
    END) IS_FIRST_CHILD_CASE
    FROM SA.TABLE_CASE THIS_CASE,
    (SELECT PARENT_OBJID,
    CHILD_OBJID FIRST_CHILD_OBJID
    FROM (SELECT PARENT_CASE.OBJID PARENT_OBJID,
    CHILD_CASE.OBJID CHILD_OBJID,
    CHILD_CASE.CREATION_TIME,
    ROW_NUMBER() OVER (PARTITION BY PARENT_CASE.OBJID
    ORDER BY CHILD_CASE.CREATION_TIME ASC) ROW_NUM
    FROM SA.TABLE_CASE PARENT_CASE,
    SA.TABLE_CASE CHILD_CASE
    WHERE PARENT_CASE.OBJID = CHILD_CASE.CASE_VICTIM2CASE
    WHERE ROW_NUM = 1
    ) PARENT
    WHERE THIS_CASE.CASE_VICTIM2CASE = PARENT.PARENT_OBJID(+)

    Thank you for the quick reply.
    Here is the explain plan:
    Operation     Object Name     Rows     Bytes     Cost
    SELECT STATEMENT Optimizer Mode=CHOOSE          2 M          32831
    HASH JOIN OUTER          2 M     130 M     32831
    TABLE ACCESS FULL     SA.TABLE_CASE     2 M     24 M     21550
    VIEW          307 K     11 M     10130
    WINDOW SORT PUSHED RANK          307 K     7 M     10130
    MERGE JOIN          307 K     7 M     8666
    TABLE ACCESS BY INDEX ROWID     SA.TABLE_CASE     307 K     4 M     1266
    INDEX FULL SCAN     SA.IND_CASE_VICTIM2CASE     307 K          738
    SORT JOIN          2 M     19 M     7400
    INDEX FAST FULL SCAN     SA.PK_TABLE_CASE     2 M     19 M     785
    Please let me know.
    Thank you.

  • So I just got my iPhone 5s and there appears to be a dead pixel on the top of the screen. Is there anything that could be done?

    I was curious If anything could be done about a dead pixel on the top of my iPhone 5s screen? And I bought the phone directly from ATT if that makes a difference.

    Take the iPhone back to ATT and show them the dead pixel on the display and get the iPhone replaced.

  • HT3226 my mail will just not open, when i try to open it it just gets stuck with the mail home page half open and when i click on the icon at the bottom it says app not responding, is there anything i can do myself or is this a trip to the Apple store?

    My mail app will not open at all, it just gets stuck half open and then when i go to the icon below it says the app is not responding, is this something i can fix myself?

    Please follow these directions to delete the Mail "sandbox" folder.
    Back up all data.
    Quit Mail.
    Triple-click the line below to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder — not just its contents — to the Desktop. Leave the Finder window open for now.
    Relaunch Mail and test. If the problem is resolved, you'll have to recreate some of your Mail settings. You can then delete the folder you moved and close the Finder window. If you still have the problem, quit Mail again and put the folder back where it was, overwriting the one that may have been created in its place. Post your results.
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard (command-C). In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.

  • When I downloaded iOS 6 my iPod keeps crashing when on the App Store! Do you know why this is happening? Is there anything I can do?

    When I downloaded iOS 6 my iPod keeps crashing when on the App Store! Do you know why this is happening? Is there anything I can do?
    Hello my iPod keeps crashing when I downloaded iOS 6
    Is there anything that I have done wrong?
    My iPod is a is a iPod touch 4th gen.
    Thanks

    Known problem. See:
    IOS 6 App store crash: Apple Support Communities

  • The third row on my MacBook Pro keyboard is not responding is there anything I can do

    The third row on my MacBook Pro keyboard is not responding is there anything I can do

    You should also ask this in the MacBook Pro forum. This is the forum for the 13” white and black plastic MacBooks that were discontinued in 2010. You should also post this question there to increase your chances of getting an answer.
    https://discussions.apple.com/community/notebooks/macbook_pro

Maybe you are looking for

  • Visio Web Access web part connection order

    I have a Visio Web Access webpart that is currently connected to 3 different query filter webparts.  Here is what the query filter webparts are doing  - #1 - This is passing in the page name to the "Web Drawing Url and Page Name" connection  - #2 - T

  • Integration Engine RED in Component Monitoring

    Hi All, I find Integration Engine as RED in the component monitoring..Any idea why? Also my messages are not processed...I mean I dont find anything in the Runtime workbench or SXMB_MONI.. Please let me know your valuable inputs.. Any suggestions/inp

  • Skype keeps crashing 7.4

    Hi, Everytime I try to call somebody on skype it freezes my computer and I cant do anything. I have tried un installing skype and reinstalling and still freezes.  I am on windows 7 and never had a problem until 7.4.  Everytime it freezes I have to re

  • How do you cancel an auto re-newing subscription?

    i accidently made a subscription, i dont want it nor do i want it to be re-newed... if someone can help me cancel the subscription that would help, if not at least make the re-newing stop.

  • Autocommit problem in JBoss

    I've created a web application using Sun Creator 2.1 and try to deploy it in JBoss 4.0.4. However, I saw the following exception: 14:33:26,329 ERROR [STDERR] java.sql.SQLException: You cannot commit with autocommit set! 14:33:26,329 ERROR [STDERR] at