Connect by clause is too slow

All, I really need help on this.
Here is my sql code. This code is taking too much time. I mean, this sql code is running inside the cursor for loop. For loop is looping 6500 times. I am using bulk insert on for loop.It is talking 6 hours to complete the job. I wanted to reduce the time. Can any expert can take a look at this select statment.
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production
select distinct
null csi_material_dim_sid,
a.solution_cd,
b.solution_desc solution_desc,
a.capability_cd,
c.capability_desc capability_desc,
a.resource_cd,
d.resource_desc resource_desc,
a.source_system
from
(select
ind,solution_cd,capability_cd,resource_cd,
doc_item_num,doc_higher_lvl_item_num,source_system from (
select
level ind,
solution_cd,
(case when level=2 then capability_cd else prior capability_cd end)
capability_cd,
(case when level=3 then resource_cd else prior resource_cd end) resource_cd,
doc_item_num,
doc_higher_lvl_item_num,
source_system
from
select
ind,
solution_cd ,
capability_cd,
resource_cd,doc_item_num,
doc_higher_lvl_item_num,
doc_ref_matl_num,
source_system
from
(select
level ind,
case when level=1 then doc_matl_num else doc_ref_matl_num end solution_cd,
case when level=2 then doc_matl_num end capability_cd,
case when level>2 then doc_matl_num end resource_cd,
doc_item_num,
doc_higher_lvl_item_num,
doc_ref_matl_num,
source_system
from
(select /*+ parallel(csi_mat_stg,6) */
doc_matl_num,doc_item_num,doc_higher_lvl_item_num,doc_ref_matl_num,
source_system
from csi_mat_stg
where doc_num ='xxxxxxxxx'
start with doc_higher_lvl_item_num=0
connect by prior doc_item_num = doc_higher_lvl_item_num)
connect by prior doc_item_num=doc_higher_lvl_item_num)
where resource_cd is not null and capability_cd is not null) a,
csi_material_master b,csi_material_master c,csi_material_master d
where
a.SOLUTION_CD=b.solution_cd and
a.capability_cd=c.capability_cd and
a.resource_cd=d.resource_cd

start with this sub-query:
select /*+ parallel(csi_mat_stg,6) */
doc_matl_num,doc_item_num,doc_higher_lvl_item_num,doc_ref_matl_num,
source_system
from csi_mat_stg
where doc_num ='xxxxxxxxx'how long does this takes to complete with and without the hint?
a good starting point is to check from the most inner query to see where the bottleneck is.

Similar Messages

  • How can I make Time Machine use the ethernet cable to Time Capsule instead of the wireless connection? Wireless is too slow; has been taking 40 hours to create an initial 142 GB backup.

    How can I make Time Machine use the ethernet cable to Time Capsule instead of the wireless connection? Wireless is too slow; has been taking 40 hours to create an initial 142 GB backup.

    Plug in ethernet .. in the computer.. turn off wireless.

  • Connection to Server is too slow!

    Ok, I have a bit of a problem here. I have a server set up with 4 users connected. It takes forever to even load all the folder icons when you connect to the server and open the window. I looked at the AFP information pane in the Server Admin program and it reads that we are getting less than 1MB/Sec. Is there another way for us to connect directly to the server so we can get better speeds or is something not set up correctly?

    For what it's worth, I seem to be having the same problem. I don't have any detailed troubleshooting info to relay yet (forgot to enable error logging, ooops). I've just brought a 10.5.1 AFP only file server (XServe quad Xeon via Gigabit) online this morning for 20-30 users following a week of testing with a limited user base (3-5). The server is hosting 12 share points from four SCSI RAID arrays via Apple's SCSI card. CPU usage is at about 10%, spiking at 40-50% on occasion. Throughput has averaged around 12MB/s. Didn't have any issues while I was in testing (save the Kerberos ticket expiration problem, which I fixed by disabling Kerberos login).
    For what it's worth the 10.4.10 Server (G4, 1.4GHz) sharing the same volumes never had a hiccup like this.

  • I just brought a brand new Macbook pro retina display, when i connect it to my apple tv through airplay its too slow and when it try to play a movie apply tv is always a minute or 2 behind. How can i fix this?

    I just brought a brand new Macbook pro retina display, when i connect it to my apple tv through airplay its too slow and when it try to play a movie apply tv is always a minute or 2 behind. How can i fix this?

    Hello HanaAmer1,
    We've an article which provides troubleshooting steps that can help get AirPlay workign correctly.
    iTunes: Troubleshooting AirPlay and AirPlay Mirroring
    http://support.apple.com/kb/TS5209
    Cheers,
    Allen

  • Internet connection too slow, is there a way to speed up the itouch?

    So I can connect to Facetime, but all I see is a picture of a person and then the Itouch freezes and shuts down. I think it is because my internet connection is too slow, because it only doesn't work in my apartment (it works at places with quicker connections).
    The question is, is there currently a fix to this problem (I can't be the only one who has it)? It all works, just freezes after connecting and showing the picture of the person I'm talking to then disconnects. Is there a way to make this work?
    I'm at college and the only reason I got the 4g from my parents is 'cause they wanted me to help my little bro with homework back home... but if Facetime doesn't work at college then I should sell mine and go with a cheaper, earlier generation. Thanks!
    Message was edited by: ClassyCoug

    By what type of security I mean, WEP (not preferred), WPA, WPAs. I would go to the support page for you router on the manufacturer's sit to see if an update to the firmware is available. You also have to enter the setup for the router to determine the installed version of the firmware. Not infrequently a firmware update fixes problems since that is one purpose of the updates.

  • I have an ipad3(wifi  cellular). Now i want to upgrade my iOS5.1 to ios 7. But download speed in our country is too slow(100kbps). It can be disconnected anytime. Is there any problem if net connection get disconnected while upgrading ios? Please ans me.

    I have an ipad3(wifi +cellular). Now i want to upgrade my iOS5.1 to ios 7. But download speed in our country is too slow(100kbps). It can be disconnected anytime. Is there any problem if net connection get disconnected while upgrading ios? Please ans me.

    haha, so now i'm thinking. I'm learning the terminal as fast as i can but there are several lines of codes and commands in there that throws up red flags to me that i don't fully understand. It just looks fishy too me. It would be highly appreciated if someone could just check this out just to tell me that i don't need to worry about it. Or point me in the right direction. I just feel un easy about this. ha.

  • Dial up connection too slow

    Server:linux
    databse:9i
    Jinitiator 1.3.1.13
    We try to connect to our application using dial up connection
    ,it was too slow to initiate jinitiator
    ,how can i solve this problem

    Hi baxel, try from your library computer to download from the next link :
    https://www.mozilla.org/en-US/firefox/all/
    then put it on a flash drive and install to your home pc.
    the above link with all languages and systems (windows, Mac OS X Linux) exist also in mozilla.org in green box as Systems & Languages link.
    thank you

  • I'm on a prepaid plan for the 4s, i want the hotspot option which isn't offered on the prepaid plan.  heard the connection is too slow on the 4s only worth it on the 5 or 5s. would you agree? not sure how much the hotspot would increase my monthly bill...

    i'm on a prepaid plan for the 4s, i want the hotspot option which isn't offered on the prepaid plan.  heard the connection is too slow on the 4s only worth it on the 5 or 5s. would you agree? not sure how much the hotspot would increase my monthly bill....

    To use the hotspot for any of those devices, I believe you have to switch to a postpaid account and plan. You can see the pricing for the available postpaid plans under the "Shop" area of the website.

  • MySQL Connection too slow

    Please anyone with expirience in applets accessing MySQL Server!
    I made a test with a loop code executing queries and got the following conclusion:
    In media a query takes more than 2 seconds. I used PrepareStatement for better performance but it doesn�t make it better. I�ve heart about persistent connection. It�s realy faster? You know anything I could do for better performance? Obs.: When I ping my server the time answer is 200 ms. I�m from Brazil. But I think it sholdn�t make the mysql too slow as it is. Please help me.....
    I�m very thank for ur help..
    My java code:
         public void ConectaBD()
              try
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
                   //Class.forName("org.gjt.mm.mysql.Driver").newInstance();
              catch(Exception e)
                   System.out.println("Error: " + e);
              try
                   con = DriverManager.getConnection("jdbc:mysql://labinfor.com.br/labinfor_codvirtual?user=labinfor_cliente&password=800091");
              catch(SQLException e)
                   System.out.println("Error: " + e );
                   e.printStackTrace();
    public void Logon()
                   java.util.Date start = new java.util.Date();
                   long startTime = start.getTime();
    if (ValidaCPF(TFCPF.getText()))
    queryLogon = "SELECT Nome FROM clientes WHERE CPF='" + TFCPF.getText().trim() + "' AND senha='" + TFSenha.getText() + "'";
    int indCon=0;
    Timer t = new Timer(1000, this);
    t.start();
    while(indCon<100)
         Conecta();
         try
                   stmt[indStmt] = con.createStatement();
         rsLogon = stmt[indStmt].executeQuery(queryLogon);
         Achou = "false";
         while (rsLogon.next())     
         Achou = "true";
         StrNome = rsLogon.getString(1);
         LValidaCPF.setText("Bem-vindo " + StrNome);
         TFCPF.disable();
         TFSenha.disable();
         BLogon.setLabel("Logoff");
                                       System.out.println("delay["+indCon+"]= "+System.currentTimeMillis());
         if (Achou == "false")
         LValidaCPF.setText("CPF ou senha incorreto");
         Desconecta();
         catch(Exception e)
         System.out.println("Error: " + e);
         indCon+=1;
    }

    Connection times of 1 to 5 seconds are normal. Pool your connections.
    To understand why:
    First, setting up a TCP/IP connection takes roughly 50% longer than a ping; a ping is one packet to the server and one packet back, a TCP/IP handshake to create a connection is one packet to the server, one back, and another to the server. Then you have a required brief wait before the connection is considered complete; we'll ignore the wait and call it .3 seconds for the TCP/IP handshake.
    Second, the database has to go through the login process. Just sending the login request and response is yet another packet round trip; in your case, that's another .2 seconds in just network time alone. With MySQL, the login involves checking the security of the connection and the user; it often requires a reverse DNS lookup on the IP address of the client. Probably 4 or 5 tables have to be queried and a user environment is created within the server. The server work for the login might take .75 seconds, at a guess. Adding the network time makes this step .95 seconds or so.
    Third, there's the time it takes to do the query itself; another network round trip; .2 second network round trip, plus maybe .1 second to run the query on the database, for a total of .3 seconds.
    Fourth, there's the time it takes to tear down the TCP/IP connection on connection close. That involves 4 packets, 2 round-trips, so add another .4 seconds.
    Adding it all up, you get .3 + .95 + .3 + .4 = 1.95 seconds, of which .3 is your SQL query (network and DB time), .9 is network time for TCP/IP connection and login request, and .75 is DB time for the login.

  • Why is the same wirelles connection too slow for an iphone4 when it is quite fast to an iphone5?

    Why is the same wirelles connection too slow for an iphone4 when it is quite fast to an iphone5?

    You really have a question for iPhone support here, so I suggest that you post in the appropriate support area:
    Using iPhone
    The experts over there will likely suggest that you use the Apple Troubleshooting Guide for iOS devices, so you might want to work your way through that before you post in the iPhone support area.
    http://support.apple.com/kb/TS1398

  • After updating to 4.3 I can't connect to wi-fi because the "internet speeds are too slow". How much speed does this require?

    After updating to 4.3 I can't connect to wi-fi because the "Internet speeds are too slow". So what speed does it need?

    I called tech support and I got the same **** canned response, backup and reset to factory settings.  Yeah right!  Everything was fine until Verizon shoved the software update down my throat.  I finally unchecked the box in Wi-Fi settings for auto network switch.  However, I still get the "Your Internet connection is unstable" warning no matter what Wi-Fi connection I hit.
    In a related story, I received a new or refurbished phone as my original SIII had AC/charging connection issues.  I called probably three times to attempt to back up my data, went into two stores in attempts to have them transfer the information over, and all were too incompetent and inept to assist me.  Only when talking to someone about this Wi-Fi issue, did someone actually know how to back up everything.  Of course by this time, I had to send the new phone back because Verizon charged me $400 before I got everything squared away.  What a colossal waste of my time!

  • HT1766 I have an ipad3(wifi +cellular). Now i want to upgrade my iOS5.1 to ios 7. But download speed in our country is too slow(100kbps). It can be disconnected anytime. Is there any problem if net connection get disconnected while upgrading ios? Please a

    I have an ipad3(wifi +cellular). Now i want to upgrade my iOS5.1 to ios 7. But download speed in our country is too slow(100kbps). It can be disconnected anytime. Is there any problem if net connection get disconnected while upgrading ios? Please ans me.

    There is something Definitely wrong with iOS 7 regarding DATA USAGE being logged to wireless carrier in for WIFI instead.
    I read all the previous replies and same issue.
    I rarely use my mac to sync....its all wifi sync for the last 2 years....never had this issue before... and i know it began with iOS7.... here is why....
    My iPhone was at home when I updated to iOS7 connected to wifi...but it logged Data Usage to Rogers Wireless (700MB approx)...data will never do an update over 50mb in app store (it gives the warning to use wifi) I play a lot of games and pay for them so I always update through App Store.  2 weeks later, simposons halloween update (650mb)...at home, using wifi.
    Rogers told me there was 700+mb data usage on the day of update and 650+mb data on oct 1.st (tapped out).
    Went over my 6GB plan and paid the fees.
    This has never happened before...It must come to apples attention by now...

  • I am U.S. iPhone 4S user traveling in China.  Data speed is too slow to be usable.  Verizon says that it because iPhone 4S connects to strongest signal even if slowest.  Any work arounds for this design flaw?

    I am U.S. iPhone 4S owner traveling in China.  Data speed is too slow to be usable.  Verizon says that is because iPhone 4S connects to strongest signal, even if slowest (virtually non-existent) data network.  Does anyone know how to work around this design flaw?

    I spent 2 months in china with my old iphone 3gs.  Both China Unicomm and China Mobile were accessible through my US phone.  (for you other users, yes my phone bill was sky high, but it's a small price to pay when you get instant access to your wife while you are gone... and to be able to use the google translate app).  I had a GSM phone (obviously) and had the ability to choose what carrier I wanted my phone to connect to (the same thing was available when I was in italy as well). 
    it was under
    general-> network> then there was a new field (that does not normally show up when in the US) that listed the available networks to connect to.  my phone always attempted china unicomm first, and switched to china mobile only when unicomm was unavailible. 
    but if wjosten is correct (and i imagine he is), cdma phones may not be able to choose what network to connect to. 

  • HT4061 After latest software update(IOS 5.1.1), connectivity is too slow on Ipad

    After I upgraded my iPhone 4 and iPad 2, network connectivity or connectivity as a whole is too slow. Almost all the Apps dies with time out. Is there a solution to this? This problem persists in wifi as well as 3G network.

    3G is painfully slow since the 5.1.1 update for me too. Turning off wi-fi seems to help some, but it's still noticeably slower. I hope apple is working on a patch or I'll be trying to restore back to 5.1 which ran fine.

  • Im trying to download the Io6 update but my connection is too slow and the update is too big is there another way to download the update?

    Im trying to download the Io6 update but my connection is too slow and the update is too big is there another way to download the update? Any ideas or help and what can i do? The update starts again if it is paused

    Use your friend's internet to update.

Maybe you are looking for

  • Reporting on Virtual Cube - DTP Authorisation is required??

    Hi all, Say there is a Virtual Cube V, i have multiprovider on top of it M, When i am running report on this M, it is saying as there should authorization to run the DTP's. Is it necessary to have DTP authorizations, to run a report on Virtual cube??

  • Unable to see files in iTunes File Sharing

    I'm using the latest version of iTunes, and have both an iPad and iPad2, both fully upto date with the latest version of IOS. Everything I now write about applies to both iPads. Basically, I'm unable to see files that are sent to iTunes from the iPad

  • Scanning from Mac OS 10.9 to HP PSC1510

    I have used an (HP) PC for years, the last few using an HP PSC1510 printer. I have recently bought an iMac, OS 10.9, and am having difficulty getting the functionality from the printer that I used to. I am able to print, pure and simple, but the HP S

  • Supported Cameras

    I was wondering if there was a list of video cameras that work with Apple / Firewire / iMove HD ? I've been hunting around the Apple website and I can't quite seem to find one. I'm thinking of getting a new video camera (right now I have a Sony Hi8).

  • Getting users disabled/deleted with disabled resources in OIM

    Hi, Consider following use case related to OIM: To get the Users deleted or disabled on a particular date with their 'AD User' resources which are in disabled state. By means of built in reports i can get the users disabled or deleted for particular