REGEXP_SUBSTR, CONNECT BY slowing down with value

I have the following sql code

SELECT distinct q.broker_ID, q.user_ID, q.MGC_BREACH_ALERT, REGEXP_SUBSTR (nvl(q.CGC_ALERT_THRESHOLDS,0), "[^ |]") +', 1, LEVEL) value

Of

(select u.broker_ID, t.user_ID, t.CGC_ALERT_THRESHOLDS, ATSD_USE_TRADERS t.MGC_BREACH_ALERT t, ATS_USERS u where u.user_ID = t.user_ID and t.sponsored_user = 1) q

CONNECT TO  (REGEXP_SUBSTR (nvl(q.CGC_ALERT_THRESHOLDS,0), "[^ |]")) +', 1, LEVEL) IS NOT NULL)

order by 1

When all the values in the table has CGC_ALERT_THRESHOLDS as two pipes separate values (for example 34 | 44) the query runs in less than 1 second.


When the CGC_ALERT_THRESHOLDS are the three values of separate pipes (for example 34: 44 | 54) then the request takes longer than 30 seconds to complete.

The table has only 150 lines.


Can you please explain where I have gone wrong / or any other suggestions for improvements to this request?

Hello

Whenever you have a question, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the accurate results you want from this data, so that people who want to help you can recreate the problem and test their ideas.

Explain, using specific examples, how you get these results from these data.

Always say what version of Oracle you are using (for example, 11.2.0.2.0).

See the FAQ forum: Re: 2. How can I ask a question on the forums?

Jones wrote:

I have the following sql code

SELECT distinct q.broker_ID, q.user_ID, q.MGC_BREACH_ALERT, REGEXP_SUBSTR (nvl(q.CGC_ALERT_THRESHOLDS,0), "[^ |]") +', 1, LEVEL) value

Of

(select u.broker_ID, t.user_ID, t.CGC_ALERT_THRESHOLDS, ATSD_USE_TRADERS t.MGC_BREACH_ALERT t, ATS_USERS u where u.user_ID = t.user_ID and t.sponsored_user = 1) q

CONNECT TO  (REGEXP_SUBSTR (nvl(q.CGC_ALERT_THRESHOLDS,0), "[^ |]")) +', 1, LEVEL) IS NOT NULL)

order by 1

When all the values in the table CGC_ALERT_THRESHOLDS as two pipes separate values (for example 34: 44) the query runs in less than 1 second.

When the CGC_ALERT_THRESHOLDS are three pipes separated values (for example 34: 44 | 54) then the query takes more than 30 seconds to complete.

The table has only 150 lines.

Can you please explain where I have gone wrong / or any other suggestions for improvements to this request?

Whenever you are tempted to use SELECT DISTINCT, think very carefully about why you need it.  It is often a way to hide an error in the query.

In this case, the error is using CONNECT BY on a multiple row table, without conditions PRIOR involving.  If you have 150 rows in the table, this means that you will

150 lines level = 1,

150 * 150 = 22500 ranks LEVEL = 2,

150 * 150 * 150 = 3375000 rows = 3 LEVEL.

...

Soon, which will be a large number of lines.

You must change the CONNECT BY clause into something like:

CONNECT BY REGEXP_SUBSTR (NVL (q.cgc_alert_thresholds, '0'))

, '[^|] +'

1

LEVEL

) IS NOT NULL

AND PRIOR SYS_GUID () IS NOT NULL

AND PREREQUISITE uk = uk - uk is a unique key

I can't be sure without your sample data.

Tags: Database

Similar Questions

  • End of Cup Video Clip off the power when send you first Pro CC 2014 to effects after 2014 CC and I slowed down with Timewarp?

    When I send a clip from Premiere Pro CC 2014 to after effects CC 2014 and I slowed down with Time warp the clip cut of 75% at the end of the video and display only the first 25% slow.  How can I fix this and how I round it travels in first pro to play the FULL slow motion video clip?

    Try adding effect temporal Deformation on an adjustment layer in AFX, rather than on the video it self.

  • Connecting to a remote database (slowed down) with the password file authentication

    Hi all

    I was wondering if it is possible to connect to a remote database is stopped (idle instance) as user sys with sysdba privileges? It is said in the Oracle book - one to page 210 in the section - operating system and the file password authentication:

    Connection with authentication by password file or operating system is always possible, any State of the instance and the database are in and it is necessary to issue commands to START or STOP.

    Above indicates that it is possible, but I can't do it.

    I managed to connect to the remote database that was in mode nomount (see below for more details).

    When I first tried to connect to a remote database (idle instance) using the password file authentication, it gave due to error:
    sqlplus sys@ORCL as sysdba
    SQL * more: Production of the version 11.2.0.3.0 Fri dec 21 13:59:28 2012

    Copyright (c) 1982, 2011, Oracle. All rights reserved.

    Enter the password:
    ERROR:
    ORA-12514: TNS:listener is not currently of service requested in connect
    descriptor of

    Enter the user name:

    After the start of the database in nomount mode I was getting following error:
    sqlplus sys@ORCL as sysdba
    SQL * more: Production of the version 11.2.0.3.0 Fri dec 21 13:48:36 2012

    Copyright (c) 1982, 2011, Oracle. All rights reserved.

    Enter the password:
    ERROR:
    ORA-12528: TNS:listener: all appropriate instances are blocking new connections

    Enter the user name:

    Then I added the clause (UR = A) my listener.ora file and after that it work and I was able to connect:
    sqlplus sys@ORCL as sysdba
    SQL * more: Production of the version 11.2.0.3.0 Fri dec 21 14:04:49 2012

    Copyright (c) 1982, 2011, Oracle. All rights reserved.

    Enter the password:

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    With partitioning, OLAP, Data Mining and Real Application Testing options


    SQL >

    I have all the entries of necessairly in tnsnames.ora on my local host.

    Also, I have no problems when connecting as user sys with sysdba when the DB is open, but can't get it working on an idle instance.

    I know I can use OS authentication but want to know if there is a mistake in the book or I'm doing something wrong.

    Kind regards
    Dawid

    Edited by: 978239 2012-12-21 06:24

    I was wondering if it is possible to connect to a remote database is stopped (idle instance) as user sys with sysdba privileges?

    You can, but you need to statically register the database with the listener.

  • Why my iMac 27 "slows down with Sierra?

    I'm running an iMac 27 "(fin 2012) with 32 GB of RAM drive and 3 TB of fusion." Before loading to Sierra, Adobe InDesign CS6 launched and ran fast as most of the data have been stored in the partition of the flash player. After the installation of Sierra, I noticed the app stops or slows down when I click on the items in the Panel and I get the spinning wheel. Is it because Sierra sends data to Cloud Drive when I'm online, or is something else operating here? It is most annoying. I'll try to clear the caches etc. but I don't know what is happening.

    Photoshop CS6 seems OK.

    I always forget to 'CONTROL THE FONTS'. I use FontExplorer Pro to make sure that I only have the necessary fonts to work. I forgot to re - organize my fonts folders for system font numbers are reduced to the minimum and FontExplorer only loads the necessary fonts. I will do this job very long, but I don't know that it will solve one of the main problems. For more information on Mac OS X font management see site and information http://www.jklstudios.com/misc/osxfonts.html of Kurt Lang

  • Slow down with games and video on a Satellite P100-286

    When to play games and watch the video of the computer really slow down. This does not happen immediately, but after a little while.

    I check the Task Manager to see if anything else is running and the dwrm.exe has a heavy load of CPU, add to the use of the processor of the game and the two pocessors are struggling, as seen on the gadget processors. The games are unplayable and video very bad when this happens.

    When none of those who are running, dwrm.exe is 02 CPU usage when either run dwrm.exe is 45 CPU.

    Is this a Vista problem? If anyone can help, I would be grateful or should I call Toshiba?

    Hello

    can you describe the programs you have on your system? Maybe theres some program that looks at your other programs (perhaps an Antivirus or a private firewall or something else) and suck your platform performance.

    A suggestion from me: try to uninstall some programs that you have installed and beware of what your machine.

    So, I have to say that Vista needs a lot of resources, and there are so many people who is angry and frustrated of stand-alone and Vista, so I am too.
    But let´s wait, because out of XP, it was the same thing with the first service pack they solve so many problems and triggered the performance of this system for anyone who can work now and is enjoying XP.

  • connection sometimes slows down and drops onec in awhile

    on a web site as now just everthing slows down and sometimes stops loses connetion HELP

    on a web site as now just everthing slows down and sometimes stops loses connetion HELP

    http://support.Microsoft.com/kb/314095

    How to troubleshoot possible causes of Internet connection problems in Windows XP

    also:

    http://Windows.Microsoft.com/en-AU/Windows/network-connection-problem-help#network-problems=Windows-XP&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    Wireless and wired network problems
     
     
  • computer slows down with every automatic update of windows xp

    Windows automatically downloads updates for xp.  Computer slows down gradually with each update.  Windows ' temp' directory is filled with huge files, apparently to each update.  Is there a solution?

    .  Is there a solution?

    The empty user and the 'temp' system folders.

    1. empty " %systemdrive%\temp " folder.

    2 empty " %systemdrive%\%windir%\temp " folder.

    3 empty " %systemdrive%\Documents and Settings\%username%\Local Settings\Temp "

    06/23 / 1111:23: 47 am

  • Acer laptop computer slows down with Orion running in Vista

    I have the same problem. I use Windows Vista with my Acer and the laptop slows down and ends up hooking up often enough (despite the fact that I updated to 4G). When I did an extinction forced because I could not stop more that once I saw the Orion message runs. If I remove Orion in my system, will hit anything?

    Hi news,.

    Please provide more detail about the Orion program.  In addition, please see the following article to help with performance on your machine:

    http://Windows.Microsoft.com/en-us/Windows-Vista/optimize-Windows-Vista-for-better-performance

    I hope this helps!

    Debra
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • Lightroom CC/6.3 slow down with use

    Hi all

    I have searched the forum and read many responses and tried a number of proposed solutions and am coming at the end of my tether. My voice can be added to the chorus of 'Lightroom CC short miserably slow'. For me in the past few days the specific problem that was after about 10-15 minutes of use LR slows down and becomes unstable, requiring a Windows 'end of task"command. This happened earlier while I was working in the library module, re-keywording within a collection that contains about 500 photos. Selection of about 20 photos and remove them from the collection set LR kneeling. Other operations that cause slowdowns are publish and export measures. But even during the selection of 3 or 4 pictures in order to apply the keywords a second ago or two of delay before the photo is selected, even when I just started LR - and the longest LR is open, the slower, he gets. It's AGONIZING.

    Here are the facts on my system:

    Version of Lightroom: CC 2015.3 [1052427]

    Operating system: Windows 10

    System architecture: x 64

    Number of logical CPUs: 4

    Processor speed: 3.4 GHz (i5)

    Built-in memory: 12173,8 MB

    Real memory for Lightroom: 12173,8 MB

    Real memory used by Lightroom: 898,3 MB (7.3%)

    Memory cache size: 0.0 MB

    Maximum thread count used by Camera Raw: 4

    Camera Raw SIMD optimization: SSE2, AVX

    System DPI setting: 96 DPI

    Composition of the Bureau enabled: Yes

    Exhibition: 1) 1920 x 1200, 2) 1680 x 1050

    Graphic processor Info: AMD Radeon HD 7700

    Check the supported OpenGL: past

    Vendor: ATI Technologies Inc.

    Version: 3.3.13416 context 15.300.1025.1001 the base profile

    Renderer: AMD Radeon R7 200 series

    • My boot drive is an SSD, but also the drive on which is installed the Lightroom and the catalogue
    • The LR SSD has a free space (more than 170 GB)
    • My main catalogue contains about 43000 pictures and the size of the catalog file is 1.4 GB
    • All my photos are on an array of Raid 2 - internal HD (with enough free space)
    • I optimized my catalog (several times!)
    • I deleted the folder preview.lrdata and rebuilt
    • Turn on/off the GPU support has no effect
    • The anti-virus does not scan photos or albums in Lightroom
    • None of my catalog photo places in the records accessed by Microsoft OneDrive or other synchronization services
    • My LR cache size is set to 40 GB

    Now, I know that I don't have the latest graphics card or the fastest system, but I know that under Windows 8/LR 5.x, I didn't have these problems. And I don't mean the develop module - my problems are mostly in the library module in what one might think are simple: scrolling, selection and Keywords.

    If there's something I forgot I would be happy to advice. Above all, I want to just Adobe to read and know that there is one more dissatisfied customer out there who is dying just for the fixed program.

    Cheers, Sara

    It's the topic done dj_paige refers to:

    is there a way to speed up scrolling library inches?

    You can also try to work with the metadata Panel completely closed. Do a right click on a header Panel and uncheck the "metadata".

  • IMac slows down with "safari web content (not responding)."

    I have an Imac mid-2010 running El Capitan. I constantly get a message on my activity monitor which causes my mac slow down and sometimes crash. When I leave the process on the activity monitor, my computer works better up to five minutes later, when it still happens once I wonder if some may be able to give me advice. I will include a screenshot of what I see on my activity monitor.

    Download and run Etrecheck.  Copy and paste the results in your response. Etrecheck is a diagnostic tool that has been developed by one of the most respected users here (and recommended by Apple Support personnel) of the CSA to provide an overview of the system and help identify the most obvious culprits that can adversely affect the performance of a Mac.

  • Computer slows down with 15 minutes of the session opening.

    Original title: very slow computer.

    My Vista OS slows down to about 15 minutes of logging. If I clean the registry, etc. I see a lot of files, namely .mdmp, .log, .wxi, .wer and .evm files. These occupy a lot of space and appear to be responsible for my computer slowing to a point where I have to wait about five minutes before I can click on my mouse again.

    Y at - it a fix for this problem?
    Thank you. Bob

    Hello

    Perform the steps mentioned below and check if that helps:

    Method 1:

    Optimize Windows Vista for better performance

    http://Windows.Microsoft.com/en-us/Windows-Vista/optimize-Windows-Vista-for-better-performance

    See also:

    How to troubleshoot performance issues in Windows Vista

    http://support.Microsoft.com/kb/950685

    Method 2:

    Delete files using disk cleanup

    http://Windows.Microsoft.com/en-us/Windows-Vista/delete-files-using-disk-cleanup

    See also:

    Improve performance by defragmenting your hard drive

    http://Windows.Microsoft.com/en-us/Windows-Vista/improve-performance-by-defragmenting-your-hard-disk

    Method 3: try to clear the history of the system

    Step 1: Clear TEMPORARY folder:

    a. click Start , type run in the start search box and press enter.
    b. type temp in the Run dialog box.
    c. delete all files in the temp folder.

    Step 2: Clear file folder:

    a. click Start , type run in the start search box and press enter.
    b. type folder in the Run dialog box.
    c. delete all the files in the folder %temp% .

    Step 3: Clear folder Prefetch:

    a. click Start , type run in the start search box and press enter.
    b. in the Prefetch folder, delete each entry, and then restart your pc.

    I hope this helps.

  • WRT1900ACS slow down with WPA2-mixed use

    For other people, I'm sure are going to face this as well:

    At least the current firmware (1.0.0.168229), my experience has been that turning on WPA2 Personal only idle speeds of wireless for my Galaxy 6 ten times.  For example,.

    WPA2 Personal only: 40 MB/s

    WPA2/WPA mixed personal: 400 MB/s

    It can be reproduced at will on my own - I swapped it and remade the test of speed 5 times now, with the same results every time.

    Given that most of the sites recommend that you set personal WPA2 only as a means to * increases * speed, I know that I'm not the only person who's going to run this.

    Just a update in the case that everyone is facing these issues.

    The 5 Ghz and 2.4 Ghz problem turned out be limited to devices on the 5 Ghz band is not able to see / connect to a Chromecast running on 2.4 Ghz.  Other devices do not have this problem of talking to each other.

    To resolve this problem, I went in the media Prioritization\Settings and activated the WMM Support, even though I have prioritization media himself disabled.  Also, I went to Connectivity\Administration and verified to allow users to disable access to Internet in UPnP.  That fixed the problem.  I don't know if changes were necessary or not - I have seen the suggestion in a forum about an older Linksys router and he did two of them before the test.

    The massive slowdown with the Samsung Galaxy s6 remains if I set the Security Mode to WPA2 Personal (only), but goes away when I set to WPA2/WPA mixed staff, and I'm happy to leave the Mixed value.

    That addresses all the issues that I've found so far with the router.  Other than its stable summer with an excellent signal.

  • WRT320N slows down the speed of connection - terms of support of Linksys problem

    My internet connection speed slows down to about half of it is normal speed (or worse) until I have restart my router WRT320N. I see on the net that MANY other people have the same problem and can't seem to find a solution to this problem.

    I have the latest version of the firmware installed and I have the upnp is off

    I was told recently by a representative of Linksys Chat to perform this procedure, and I was wondering if anyone has tried and there set the coupling apparently daily slowdown that set in a reboot of the router for another day or two

    Here is the procedure that I was instructed to do...
    I was told disconnest the modem to the router-connect "than a PC ONLY" via a wired port #4 - reset the router by holding the button of reset in 30 seconds - switch off the router Linksys for 20 seconds and then turn it back on - check the LEDs of the Linksys router to make sure that the power, WLAN and port #4 are lit on the Linksys router. -clone the MAC - change "Mixed" wireless settings - name - change to 20 Mhz channel bandwidth and network use standard channel 11 - and in - use the Mode personal WPA - security settings and set my WPA pre-shared key password
    Before shutting down the PC and router - reconnect the modem to the router and the PC to the router - then make sure that the modem, the router and the PC are disabled for cycle a minute and the power of their back on with the modem being first - then turn on the router and last the PC

    Has anyone tried this, and he had to fix this downturn?

    Thanks in advance

    Well it's been 6 days that I woke up this morning and turned on the router and the modem from power overnight or lower I did after question troubleshooting the slow speed in the night before, does not

    I consistantly get in the 2 to 3% of the broadband speed I pay for - but I have no idea what fixed the issue

    So I'll mark it as "Resolved" and just hope that it comes not back again

    Thanks for the recommendations Klatch

  • request will slow down when an additional filter is given in the list IN

    The following query works with 1 + seconds:
    SELECT t.Owner, t.Table_Name, c.Comments, f.Column_Name, Fc.Comments
    FROM All_Tables t,
         All_Tab_Comments c,
         All_Tab_Columns f,
         All_Col_Comments Fc
    WHERE c.Table_Name = t.Table_Name
          AND f.Owner = t.Owner
          AND f.Table_Name = c.Table_Name
          AND Fc.Owner = f.Owner
          AND Fc.Table_Name = f.Table_Name
          AND Fc.Column_Name = f.Column_Name
          AND t.Owner IN ('CASINO')
          AND t.Table_Name IN ('PHYSICALTABLEGROUPS')
    ORDER BY t.Owner, t.Table_Name, f.Column_Name;
    Query below seems to work at least + 30 seconds, I don't know how long it works:
    SELECT t.Owner, t.Table_Name, c.Comments, f.Column_Name, Fc.Comments
    FROM All_Tables t,
         All_Tab_Comments c,
         All_Tab_Columns f,
         All_Col_Comments Fc
    WHERE c.Table_Name = t.Table_Name
          AND f.Owner = t.Owner
          AND f.Table_Name = c.Table_Name
          AND Fc.Owner = f.Owner
          AND Fc.Table_Name = f.Table_Name
          AND Fc.Column_Name = f.Column_Name
          AND t.Owner IN ('CASINO')
          AND t.Table_Name IN ('ADMINS', 'PHYSICALTABLEGROUPS')
    ORDER BY t.Owner, t.Table_Name, f.Column_Name;
    As you can see the only difference is with 'IN' operator. Adding more item in the request list will slow down. Why is it slow?
    I have no privileges to run explain plan for this query, because I do not have certain privileges, I think for these system objects.
    Can you explain why the request will slow down with the addition of a table over in the list.

    I found the / * + ALL_ROWS * / tip to be useful on SQL join views great dictionary, including DBA_TAB_PARTITIONS and DBA_TAB_COLUMNS, that can develop enough long.

  • Pavilion 15 - ab219tx: Internet slows down after connecting the mobile to WiFi.

    Previously, I had a problem where internet connection slowed down painfully when cell phone charges. I tried to reset the power settings. Now I can connect to the laptop... However, now the problem is that if connect you to WiFi via the laptop, regardless of if its loading or not, the internet becomes ridiculously slow. And if the wifi is turned off, it returns to normal. Help, please.

    . Hi @ARD09,

    Thanks for your reply. I review the post. I understand that drivers are a bit old. I first want to eliminate hardware issues with the computer's wireless card by performing all the steps which are associated software.

    I understand perfectly that WiFi and wired Ethernet connection both seem to be slow.

    A few steps to try:

    I hope this helps. I would like to know how this happens. I hope the problem is solved without hassle and the unit works very well. I'm always here for you help. Please reach out at any time.

    Just to say thank youPlease click the ' Thumbs Up ' button to give a Kudos to appreciate my efforts to help me. If it helps, Please mark this "accepted Solution" because it will help many other people with the same problem to get it resolved without hassle.

    Now carefully and have a wonderful week ahead.

Maybe you are looking for