Qyery dying out

How to optimize this query without using the expalin plan just by seeing the query some one can give some suggesstion
can we break this query in any way.if yes how.
samant
SELECT 'SERVICE_ORDER',
a.service_order_key,
GREATEST( NVL(a.soe_update_ts,'19000101000000'),
NVL(b.soe_update_ts,'19000101000000'),
NVL(c.soe_update_ts,'19000101000000'),
NVL(d.soe_update_ts,'19000101000000'),
NVL(e.soe_update_ts,'19000101000000'),
NVL(f.soe_update_ts,'19000101000000'),
NVL(g.soe_update_ts,'19000101000000'),
NVL(h.soe_update_ts,'19000101000000'),
NVL(k.soe_update_ts,'19000101000000'),
NVL(m.soe_update_ts,'19000101000000'),
NVL(q.soe_update_ts,'19000101000000'),
NVL(r.soe_update_ts,'19000101000000')) soe_update_ts,
a.source_system,
a.classic_objid,
a.service_order_id,
a.sales_order_key,
a.cancel_date,
b.part_status,
f.service_inst_flag,
f.domain,
c.contract_type,
NVL(c.contract_signed_date, '19000101000000'),
a.total_nrc total_nrc_local,
a.total_rc total_rc_local,
a.one_off_charge total_one_off_local,
b.installation_site_key,
d.territory_key,
a.schedule_type,
h.attribute_value,
a.service_id,
NVL(b.abp_service_start_date, '19000101000000'),
e.crd,
NVL(e.ccd, '19000101000000'),
e.icd,
c.currency,
f.speed,
e.acceptance_date,
g.service_end_date,
g.billing_start_date,
NVL(b.abp_service_end_date, '19000101000000'),
h.attribute_desc,
NVL(b.install_date, '19000101000000'),
NVL(g.create_ts, '19000101000000'),
k.org_name,
m.country_name,
e.ccd_failure_code,
e.ccd_failure_reason,
q.role_name,
a.del_ind,
h.attribute_set,
e.pad,
a.nrc_billing_account_key,
a.rc_billing_account_key,
a.usage_billing_account_key,
'' installing_csu_key,
k.bus_org_key
FROM RTS_SERVICE_ORDER_V a,
RTS_SITE_PART_V b,
RTS_SALES_ORDER_V c,
RTS_USR_TER_ROLE_V d,
RTS_KPI_V e,
RTS_X_PART_NUM_V f,
RTS_SERVICE_ORDER_ITEMS_V g,
RTS_PART_ATTRIBUTES_V h,
RTS_BUS_ORG_V j,
RTS_BUS_ORG_V k,
RTS_ADDRESS_V m,
RTS_USER_V n,
RTS_SITE_V p,
RTS_PART_ROLE_V q,
RTS_USR_BUS_ROLE_V r,
RTS_SITE_PART_V s
WHERE (a.watermark > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR b.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR c.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR d.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR e.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR f.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR g.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR h.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR k.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR m.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR q.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT')
OR r.WATERMARK > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT'))
AND a.service_order_key = g.service_order_key (+)
AND g.site_part_key = b.site_part_key (+)
AND b.part_num_key = f.part_num_key (+)
AND a.sales_order_key = c.sales_order_key (+)
AND n.user_key = d.user_key (+)
AND a.service_order_key = e.service_order_key (+)
AND a.sales_order_key = e.sales_order_key (+)
AND b.site_part_key = q.service_part_key (+)
AND q.tech_part_key = s.site_part_key (+)
AND s.site_part_key = h.site_part_key (+)
AND c.cust_bus_org_key = j.bus_org_key (+)
AND j.bt_ignite_id = k.org_id (+)
AND b.installation_site_key = p.site_key (+)
AND p.prim_address_key = m.address_key (+)
AND j.bus_org_key = r.bus_org_key (+)
AND UPPER(r.role_name (+)) = 'ACCOUNT MANAGER'
AND r.user_key = n.user_key (+)
AND UPPER(d.role_name (+)) = 'ACCOUNT MANAGER';

The first question I would ask is what is the question you are trying to answer here? By that I mean, is this desinged to answer a business question, or is it an attempt to create a "universal" view to answer any question a user or developer might have? If it is the latter, then the easiest way to optimize this is to not do it. Create several different queries/views each designed to answer a specific question, and letthe users/developers use those instead.
If it is the former, I would start by asking if you really need all those outer joins? Although there are cases where an outer join is required, I find it difficult to concieve of a situation where all the joins need to be outer joins. In fact, I believe that most of the outer joins are not required. The set of predicates
WHERE ?.watermark > RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT') ORwill eliminate the made up rows from the outer join, because NULL (the value that watermark will have if the row is made up because of the outer join) can never be greater than (not less than nor equal to, nor not equal to) anything.
Further, you are calling RTS_WATERMARK.GET_WATERMARK 12 times for each row in the query. I would try something along the lines of:
SELECT column_list
FROM table1, table2, ..., tableN
     (SELECT RTS_WATERMARK.GET_WATERMARK ('SOE_EXTRACT') wm
      FROM dual) z
WHERE < joins > and
      (a.watermark > z.wm OR
       b.watermark > z.wm OR
       . . .)Which will at worst get RTS_WATERMARK.GET_WATERMARK called once per row in the query, and at best once per query.
HTH
John

Similar Messages

  • Ever since I had my screen replaced, my laptop has slowly gone to ****. Half of my songs have been lost, webpages die out, shockwave crashes, and no I can't even sign into my laptop. Who can I contact to get this all fixed?

    Ever since I had my screen replaced, my laptop has slowly gone to ****. Half of my songs have been lost, webpages die out, shockwave crashes, and no I can't even sign into my laptop. Who can I contact to get this all fixed?

    How about the people who fixed the screen?

  • Is JSP dying out?

    There are no new JSP books. All JSP books are at least 1 year old. Everything about JSP on the internet is also at least 1 year old. I can barely find any information I need about JSP by googling things up.
    Is JSP dying out or something?

    You think that every year a book has to be written about the exact same subject or something??? You do realize that this isn't going to be very lucrative for the writers.
    As for googling, you must be using the wrong queries because I can always find what I need. The big trick is to always start the query with "java", for example "java jstl" or "java jsf tutorial".

  • Windows die out because of battery, can't boot to windows again

    Windows die out because of battery, can't boot to windows again

    Windows die out because of battery, can't boot to windows again

  • NI myDAQ signal died out

    I'm using an NI myDAQ. I generated a sine wave input signal using Matlab, saved it in a text file,and sent it via the Analog Output. I then got the input and output signals from 2 Analog Inputs. They looked  fine for 2-5 minutes and then the signals died out and became  straight lines with noise. Please advise...how to fix this?.. Thank you.

    Hello enter01,
    Can you provide some clarification to your current set up?  You said that you were generating a sine wave input.  Is that on an AI channel that you're reading, saving, and then outputting?  Or are you generating a sine wave to output through AO directly?
    You're also reading from two AI channels.  Are these completely separate signals from that generated sine wave?  Is one of these channels reading the input from the AO channel outputting the sine wave?  What is the other channel reading?  Where is this signal coming from?
    After 2-5 minutes, these signals die out and become straight lines with noise.  Does it look like these noise readings are around 0V?  If not, is there a DC offset?
    Are you doing all your programming in LabVIEW, other than just generating the sine wave?  If so, can you use the following examples to run this and see if you're observing the same behavior?  Continuous Analog Acquisition, and Continuous Analog Generation.
    Thanks,
    Lisa
    Applications Engineer
    National Instruments

  • Video Effects Die Out

    Hey,
    Near the end of a video I'm making, the video effects I'm using just gradually stop. I'm using Edge Work and Flase Color, the video is 1:47 long, and the effects start dieing at 1:36 or so. Does anybody know why? Thanks!

    .. so how do I check the format?..
    YOU did select the 'format' of your project in the 'Create New Project' dialog...
    .. I'm not sure which harddrive it's on..
    .. if you don't know.. me no psychic ... same: when creating New Project, you did choose a location.. somewhere ... somehow ..
    .. I do have an external one connected... ..
    .. and you're using it as 'out-of-the-box'? ...- which is usually wrong formatted ... follow advice given here:
    http://docs.info.apple.com/article.html?path=DiskUtility/10.5/en/duh1009.html
    to use iM in its all shining glory, use it as a DV-editor, meaning: iMovie is by concept for working with firewire connected miniDV camcorders...
    as long as you use iM as meant, no computer skills needed, if you try to teach the dog new tricks - you need some background know-how..
    here's a good start for beginners:
    http://www.apple.com/ilife/tutorials/imovie/index.html

  • Ibook g4s / dying out?

    is it just me or does there seem to be a noticeably greater number of 'ibook, blue or black screen, hard drive dying, cold restart, etc ...' posts lately? i wonder because my 5 year old machine just gave up the ghost on the weekend. (yes, it was due to that mentioned above.) (i type this from a nice and new and shiny macbook.) are we witnessing a 'critical mass' of faulty parts? i must note however, i replaced my machine gladly because, a. the repairs were too costly, (@$400) and b. i felt that since the g4 has given me nothing but stellar service over the past half decade, i couldn't complain. raymond.

    raymond:
    Congratulations on your new MacBook! Five happy years with an iBook G4 is great!
    iBooks, both G3 and G4 have been plagued with hardware issues, notably a variety of logic board issues. Yes, you see quite a few of them in these forums. Unfortunately the millions of iBook users who have not had issues and are happily computing on their iBooks don't post here, so we hear only of the problems experienced with iBooks, but not of those who are perfectly happy with them.
    One of my sons-in-law has an iBook G4 14" 1.33 GHz, and he ran into serious issues with his iBook. After swapping out the HDD a couple of times he passed it to me to see if I could help. I soon found that the ATA Controller failed. The computer works perfectly fine for him booting from an external firewire HDD. On the other hand one of my other daughters also has iBook G4 of the same vintage. Apart from some occasional OS maintenance I do for her, she is perfectly happy with her iBook G4 1.33 GHz. I have a long thread about my son's-in-law iBook in this forum, but not a word about my daughter's. That by way of illustration.
    Donating your iBook to be repaired and recycled will extend the happy years you had with it to someone else. What a deal!
    cornelius

  • PB-12 HD died out of the blue!

    Has anyone had their HD die on them Out of the blue?
    My laptop was working fine one minute, and when I went back to it a few minutes later, it was frozen. I tried to start it from the Power Button and it would not start again. The daisy wheel just spun and spun.
    I Talked to a Apple tech and he informed me that the HD looked as if it were the problem. I took it to an Apple partner store and now have been waiting for over 2 weeks for a new HD.
    The worse part was that I wanted to do a routine back up of my Home folder, but waited a day as it was my sons birthday! Now I have lost all my Notes, documents etc... Everything. Luckily there were no photos or music on the laptop, they're all on the PowerMac.
    I was wondering if I was the only one who has had this happen to them?

    Hi Six,
    I have never had this happen personally (knock wood), but as a service tech I have seen it happen. Hardware can fail with no warning, and there can be a number of reasons why. I am sorry that it happened so suddenly to you, but rest assured you are not alone out there. I hope your new hard drive gives you many years of reliable service!
    Jerefrog

  • What should you do with a new iPhone? Should I let it die out of the box the recharge? Or is it ok if I charged it over night the first night? Did I significantly hurt the battery?

    So what should I have done? Did I screw it up or will it be fine? I swapped one iPhone out already for battery
    Issues. I hope I didn't cause them myself by not letting it
    die first...

    You can leave the iPhone connected to your computer or a wall outlet as long as you want without any adverse effects to the battery.
    "For proper maintenance of a lithium-based battery, it’s important to keep the electrons in it moving occasionally. Be sure to go through at least one charge cycle per month (charging the battery to 100% and then completely running it down)."
    From here >  Apple - Batteries - iPhone

  • My iphone 4 completely died out of the blue

    Why did my iPhone suddenly die?  It was fully charged this morning and I had used it several times already today.  Hard death.  Won't reboot.  Won't synch to laptop (the laptop doesn't even know it is attached.)  Been using iPhones for years and never had a hard death like this. 

    sooner or later all electronic components die
    some sooner some later this is why company's have warranties on their electronic products

  • Display Flicker and Screen Die Outs Randomly

    I bought the MacBook Pro with Retina Display and all good stuff, however, it is giving bad flicker problem and screens seems to die suddently at times. I have to shut off the computer and then turn it on again....
    This is sad and annoying problem. After paying $3500 for a computer, this is painful.
    Can Apple fix this problem easily? Why is Apple not contacting customers and offer to fix this issue?

    The most obvious next-step solution I'm trying to avoid in trouble shooting is a clean install...that takes me down for a 1 full day, plus 2-3 days rebuilding my application preferences, plugins, serialization of sofware, etc. (I know I can use the migration assistant, but don't want to "migrate" the trouble back in to a clean system.)
    In a Mac Pro, you should have a Boot Drive with only System, Library, Applications, and the hidden unix files including paging/swap. All user files (which includes preferences) should be moved to another drive.
    Establishing a Boot Drive is one of the best Speedups you can give your multi-drive Mac. It stops the incessant "snacking" of the system from wrecking data Reads and Writes.
    Once you have a Boot Drive, you can switch to a different one (temporarily or permanently) in a few minutes.

  • Flash is dying out

    Since upgraing my flash player i'm amazed at how much flash
    content is now unavailable. today's 10 min surf added
    http://www.indianajones.com,
    http://www.hgtv.com, to the list.
    And why?
    Detection scripts.
    Developers out there are not updating detection scripts
    whenever a new version is available. Even the boys/girls at lucas
    arts don't have enough time to update the scripts.
    So why oh why can't flash handle its own updates? autoinstall
    updates? with permission of course?
    leaving it in the hands of the developer just isn't working.
    Whilst flash was once an invisible enhancement, its now a barrier
    to a lot of sites.
    Flash can't get too big for its own boots here. First things
    first, its a plug-in that has to act as a plug-in, that means it
    just can't ignore its environment.
    People aren't going to keep using flash regardless. As soon
    as it means they can't see the lasted movie trailer, or get some
    diy tips, its days are numbered.

    Have you tried Silverlight
    http://www.silverlight.net/
    and Expression Blend
    http://www.microsoft.com/expression/products/overview.aspx?key=blend
    This is one fantastic tool that most web developers can
    easily pick up.
    Javascript is what makes actions in silverlight based sites
    tick. So this
    makes silverlight more closer to the web platform. I have
    been using and its
    pretty cool.
    "MrFunkleberry" <[email protected]> wrote in
    message
    news:fprid5$n7c$[email protected]..
    > Since upgraing my flash player i'm amazed at how much
    flash content is now
    > unavailable. today's 10 min surf added
    http://www.indianajones.com,
    >
    http://www.hgtv.com, to the list.
    And why?
    >
    > Detection scripts.
    >
    > Developers out there are not updating detection scripts
    whenever a new
    > version
    > is available. Even the boys/girls at lucas arts don't
    have enough time to
    > update the scripts.
    >
    > So why oh why can't flash handle its own updates?
    autoinstall updates?
    > with
    > permission of course?
    > leaving it in the hands of the developer just isn't
    working. Whilst flash
    > was
    > once an invisible enhancement, its now a barrier to a
    lot of sites.
    >
    > Flash can't get too big for its own boots here. First
    things first, its a
    > plug-in that has to act as a plug-in, that means it just
    can't ignore its
    > environment.
    >
    > People aren't going to keep using flash regardless. As
    soon as it means
    > they
    > can't see the lasted movie trailer, or get some diy
    tips, its days are
    > numbered.
    >

  • Why does my 3gs die out randomly?

    Any ideas folks?

    Hello elliemiles,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iPhone: Troubleshooting issues making or receiving calls
    http://support.apple.com/kb/TS3406
    Best of luck,
    Mario

  • My laptop died out of the blue. It included all the songs that I have ever owned. How do I sync my iPhone 3GS and save all my music?

    How do I sync my iPhone 3Gs without losing all my music. I didn't buy all my music on iTunes. A lot of songs were from cds which I no longer have in my possession.
    Please advise.

    One of the reasons why including your iTunes library with your computer's backup along with all other important data is a good idea. The iPhone is not designed or intended to be used as a backup storage device.
    iTunes includes an option to transfer iTunes content that was purchased/downloaded from the iTunes store from an iPod, iPad, or iPhone, but this is for iTunes content that was purchased/downloaded from the iTunes store only.
    There are some 3rd party paid utilities that provide for transferring content that was not purchased/downloaded from the iTunes store from an iPhone.

  • Dispatcher dying out

    Hello All,
    I have an ECC 6.0 Ides system which is not coming up.
    Here are the relevant logs:
    Event Viewer:
    Failed to update service environment from user (.\ec6adm) environment. [ntservmgr.cpp 223]
    DEV_MS:
    ERROR => MsSClientHandle: no server provides service ENQ  (4), requested from ctsgvcsap3_EC6_00 [msxxserv.c   4693]
    DEV_W20
    X  *** Error 11 while initializing OS dependent part.
    M  *** ERROR => DpEmInit: EmInit (1) [dpxxdisp.c   10362]
    M  *** ERROR => DpMemInit: DpEmInit (-1) [dpxxdisp.c   10287]
    M  *** DP_FATAL_ERROR => DpSapEnvInit: DpMemInit
    The event viewer log points to "hostname related erro" and the work process logs points to a virtual memory issue.
    So unable to find the root cause.
    Please suggest.
    Thanks and Regards,
    Ankit Mishra

    Hello All,
    Hello All,
    After having set the below parameters in the instance profile:
    ztta_roll_first = 1
    ztta_roll_area = 2000000
    rdisp/ROLL_MAXFS = 20000
    rdisp/ROLL_SHM = 20000
    rdisp/PG_SHM = 10000
    em/address_space_MB = 256
    we get the below error in dev_rd:
    Mon Oct 10 19:23:25 2011
    gw/reg_no_conn_info = 0
    gw/local_addr : 0.0.0.0
    SWITCH TRC-RESOLUTION from 1 TO 1
    gw/process_external_ping = 1
    CCMS: AlInitGlobals : alert/use_sema_lock = TRUE.
    Bind service sapgw00 (socket) to port 3300
    ***LOG S41=> GwInitShTbl, ShmCreate ( 04) [gwxxtool.c 1533]
    ERROR => ShmDelete: Invalid shared memory Key=21. [shmnt.c 732]*** ERROR => ShmCleanup: ShmDelete failed for Key:21. [shmnt.c 806]GwInitReader: try to attach to shared memory
    GwIRegInitRegInfo: reg_info file F:\usr\sap\EC6\DVEBMGS00
    \data\reginfo.DAT not found
    GwPrintMyHostAddr: my host addresses are :
    1 : [10.226.33.14] ctsgvcsap3.cts.com (HOSTNAME)
    2 : [127.0.0.1] ctsgvcsap3.cts.com (LOCALHOST)
    Full qualified hostname = ctsgvcsap3.cts.com
    DpSysAdmExtCreate: ABAP is active
    DpSysAdmExtCreate: VMC (JAVA VM in WP) is not active
    Mon Oct 10 19:23:26 2011
    DpShMCreate: sizeof(wp_adm) 17040 (1704)
    DpShMCreate: sizeof(tm_adm) 4415616 (21968)
    DpShMCreate: sizeof(wp_ca_adm) 24064 (80)
    DpShMCreate: sizeof(appc_ca_adm) 8000 (80)
    DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
    DpShMCreate: sizeof(comm_adm) 528064 (1048)
    DpSlockTableSize: max/headSize/ftSize/fiSize/tableSize=0/0/0/0/0
    DpShMCreate: sizeof(slock_adm) 0 (96)
    DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    DpShMCreate: sizeof(file_adm) 0 (72)
    DpShMCreate: sizeof(vmc_adm) 0 (1544)
    DpShMCreate: sizeof(wall_adm) (38456/34360/64/184)
    DpShMCreate: sizeof(gw_adm) 48
    DpShMCreate: SHM_DP_ADM_KEY (addr: 07DF0040, size: 5074488)
    DpShMCreate: allocated sys_adm at 07DF0040
    DpShMCreate: allocated wp_adm at 07DF21A8
    DpShMCreate: allocated tm_adm_list at 07DF6438
    DpShMCreate: allocated tm_adm at 07DF6468
    DpShMCreate: allocated appc_ca_adm at 082322E8
    DpShMCreate: allocated comm_adm at 08234228
    DpShMCreate: system runs without slock table
    DpShMCreate: system runs without file table
    DpShMCreate: allocated vmc_adm_list at 082B50E8
    DpShMCreate: allocated gw_adm at 082B5128
    DpShMCreate: system runs without vmc_adm
    DpShMCreate: allocated ca_info at 082B5158
    MtxInit: -2 0 0
    DpRqQInit: Parameter rdisp/queue_lock_level = 2
    Mon Oct 10 19:24:19 2011
    ***LOG S30=> GwStopGateway, gateway stopped () [gwxxrd.c 15097]
    Please have a look at the above error and suggest.
    Thanks and Regards,
    Ankit Mishra

Maybe you are looking for