Query takes a long time

Hi Experts

I'm using Oracle 11 g, I use under delete query to remove records of staging table.

under query takes a long time (ranging from 1 hour, even there is no record to delete.

I created payment_id indexes also did not help.

delete from siebelwb.stg_p where payment_id not in (select * from siebel.s_src_payment)

I know NOT of IN is degreding performace, is there another way to write above request so that we can remove them in NOT IN use.

Try to use NOT EXISTS clause...

Also you inner query must match the payment_id with query parent then here's the example query...

removal of siebelwb.stg_p where THERE is NO payment_id (select 1 from siebel.s_src_payment where s_src_payment.payment_id = stg_p.payment_id)

Tags: Database

Similar Questions

  • Select the query takes a long time to run the second time

    Hi all

    I have Oracle 11 GR 1 material in windows server 2008 R2.
    I have a few tables with 10 million documents. When I run the select query to the tables of first time, it gives me a result in 15 seconds, but if I run the script even twice in the same session, I get the result in 15 minutes to complete...

    Why it's happening? What can be the solution for this?

    Thank you and best regards,
    Vikash jain (DBA Junior)

    What I know is that this feedback from cardinality generates more problems than improving the performance is, in fact, its main objective. But first look at which is was written in the link I posted above

    "Return of cardinality was introduced in the Oracle 11 g database 2. The purpose of this function is to automatically improve plans for queries that are executed repeatedly, _For that the optimizer does not estimate the cardinalities in the properly_ plan"

    If the cardinality feedback kiks in your case it is certainly because you do not have an exact statistics. Get the command the explain plans that I have shown you with the E-lines and A-lines (lines estimates and actual lines) and see where things are poorly estimated.

    If you want to disable the cardinality feedback then add the indicator according to your request

    /*+ opt_param('_optimizer_use_feedback','false') */
    

    Best regards

    Mohamed Houri
    www.hourim.WordPress.com

    Published by: Mohamed Houri on November 22, 2012 02:11
    Published by: I was looking for the exact indication of how do I deactivate the cardinality feedback and I foud in an ot the Dominic post in otn :-)

    Published by: Mohamed Houri on November 22, 2012 02:15

  • DELETE the query takes a long time

    Hi all guru.

    My Version of DB: 10.2.0
    OS: Windows Server 2003

    I run a delete on a table of paritioned command to remove all the lines in one of the parition. The command is:

    The table name is cat_in_data_052012

    delete CAT_IN_DATA_052012 WHERE name of FILE AS: SYS_B_O


    Table conatins million record.


    Thanks in advance

    >
    I run a delete on a table of paritioned command to remove all the lines in one of the parition. The command is:

    The table name is cat_in_data_052012

    delete CAT_IN_DATA_052012 WHERE name of FILE AS: SYS_B_O
    >
    Mention the name of partition specifically in the query to ensure that only one partition is affected.

    See the example (at the end) for the deletion of rows in a Partition in the SQL reference Guide
    http://docs.Oracle.com/CD/B12037_01/server.101/b10759/statements_8005.htm#i2126857

    Deleting Rows from a Partition: Example
    
    The following example removes rows from partition sales_q1_1998 of the sh.sales table:
    
    DELETE FROM sales PARTITION (sales_q1_1998)
       WHERE amount_sold > 10000;
    
  • SQL query takes too long to run (1 h 25 min)... pls help how to set up the query.

    Hello

    Could someone please help how to tune the query as its takes a long time to retrieve the results.

    Select

    col1,

    col2,

    col3,

    COL4,

    col5,

    col6,

    col7,

    COL8,

    col9,

    col10,

    Col11,

    col12,

    Sum (volume1),

    Sum (volume2),

    Sum (volume3),

    Sum (volume4),

    Sum (volume5),

    Sum (volume6),

    Sum (volume7),

    Sum (volume8),

    Sum (volume9),

    Sum (volume10),

    Sum (volume11),

    Sum (volume12),

    Sum (volume13),

    Sum (volume14),

    Sum (volume15),

    Sum (volume16),

    Sum (volume17),

    Sum (Volume18),

    Sum (volume19),

    Sum (volume20),

    Sum (rate1),

    Sum (rate2),

    Sum (rate3),

    Sum (rate4),

    Sum (rate5),

    Sum (rate6),

    Sum (rate7),

    Sum (rate8),

    Sum (rate9),

    Sum (rate10),

    Sum (rate11),

    Sum (rate12),

    Sum (rate13),

    Sum (rate14),

    Sum (rate15),

    Sum (rate16),

    Sum (rate17),

    Sum (rate18)

    Sum (rate19),

    Sum (rate20)

    Of

    Table 1 - 13, 25, 99, 400 records

    Table2 - 13, 45, 1000 records

    Table 3 - 4, 50, 000 records

    Table 4 - 1,00,000 records

    table5 - 30 000 records

    where tabl1.col1 = table2.col2,

    Table1.Col1 = table3.col1.

    table2.col2 = table3.col2...

    Group

    Sum (volume1),

    Sum (volume2),

    Sum (volume3),

    Sum (volume4),

    Sum (volume5),

    Sum (volume6),

    Sum (volume7),

    Sum (volume8),

    Sum (volume9),

    Sum (volume10),

    Sum (volume11),

    Sum (volume12),

    Sum (volume13),

    Sum (volume14),

    Sum (volume15),

    Sum (volume16),

    Sum (volume17),

    Sum (Volume18),

    Sum (volume19),

    Sum (volume20),

    Sum (rate1),

    Sum (rate2),

    Sum (rate3),

    Sum (rate4),

    Sum (rate5),

    Sum (rate6),

    Sum (rate7),

    Sum (rate8),

    Sum (rate9),

    Sum (rate10),

    Sum (rate11),

    Sum (rate12),

    Sum (rate13),

    Sum (rate14),

    Sum (rate15),

    Sum (rate16),

    Sum (rate17),

    Sum (rate18)

    Sum (rate19),

    Sum (rate20)

    Thank you

    Prasad.

    > Could someone please help how to tune the query as its takes a long time to retrieve the results.

    The query you posted is obviously fake.

    If you ask to give us a request that you do not post and we cannot see.

    For real?

  • Executions of dynamic query taking a long time

    Dear all,

    During the race the query below, it takes a long time to execute.

    [code]

    DECLARE

    statement varchar2 (1000);

    BEGIN

    FOR c1 IN (SELECT tenant_id FROM tenant WHERE tenant_id! = 0)

    LOOP

    FOR c2 IN (SELECT alignment_id FROM customer_alignment WHERE affiliation_id IS NULL AND tenant_id = c1.tenant_id)

    LOOP

    FOR c3 IN (SELECT vw.affiliation_id, vw.customer_id, vw.alignment_id, ca.customer_alignment_id

    OF ca_primary_address_vw vw, ca customer_alignment, WHERE ca.affiliation_id IS NULL

    AND ca.alignment_id = c2.alignment_id

    AND ca.customer_id = vw.customer_id

    AND ca.alignment_id = vw.alignment_id

    )

    LOOP

    Statement: = "UPDATE customer_alignment SET affiliation_id ='|" C3.affiliation_id | |' where customer_alignment_id =' | C3.customer_alignment_id;

    execute immediate (statement);

    END LOOP;

    END LOOP;

    END LOOP;

    END;

    [/ code]

    Can you please help me on this issue.

    I use the version of Oracle 11 g.

    Thanks a lot for your help.

    Miriam.

    Never perform a treatment by data line. SET the computer base. Direct use of the joints and cut single SQL. Your condition can be obtained by using the merge statement.

    merge into customer_alignment c
    using (
            select vw.affiliation_id
                 , ca.customer_alignment_id
              from customer_alignment c
              join tenant t
                on t.tenent_id       = c.tenent_id
               and t.tenent_id       != 0
               and c.affiliation_id is null
              join customer_alignment ca
                on ca.alignment_id  = c.alignment_id
               and ca.affiliation_id is null
              join ca_primary_address_vw vw
                on ca.customer_id   = vw.customer_id
               and ca.alignment_id  = vw.alignment_id
          ) t
       on (
             c.customer_alignment_id = t.customer_alignment_id
          )
     when matched then
     update
        set c.affiliation_id = t.affiliation_id;
    
  • Query taking a long time to run

    Hello

    I have a query that takes a long time to run. There are 191 000 records. This is static data only. This is the query.


    SELECT X_FIRST_NAME,
    X_LAST_NAME,
    X_MIDDLE_NAME,
    X_MEMBERSHIP_ID,
    X_ASSOCIATE_ID,
    X_MEMBER_KY,
    X_MEMBER_EXP_DATE,
    X_JOIN_CLUB_DATE,
    X_MEMBERSHIP_KY,
    X_ADDRESS1,
    X_ADDRESS2,
    X_CITY,
    X_STATE,
    X_ZIP,
    X_DELIVERY_ROUTE

    OF Canceled_Customers S
    WHERE THERE ARE
    (SELECT 'Y' FROM Canceled_Customers WHERE)
    (By SELECTING COUNT (P.X_MEMBERSHIP_KY) IN Canceled_Customers P)
    WHERE P.X_ADDRESS1 = S.X_ADDRESS1
    AND P.X_ADDRESS2 = S.X_ADDRESS2
    AND P.X_CITY = S.X_CITY
    AND P.X_STATE = S.X_STATE
    (AND P.X_ZIP = S.X_ZIP) > 1);


    Thank you

    Kelly

    Kelly wrote:
    I'm trying to capture duplicates. However, only the address information will be duplicated.

    For example:

    There might be a Jody Smith and Tim Smith with different Membership_Ky with the same address. I need to find these documents.

    Hi Kelly,

    Then you can try this statement instead, which uses only a full table on your table scan:

    select x_first_name
         , x_last_name
         , x_middle_name
         , x_membership_id
         , x_associate_id
         , x_member_ky
         , x_member_exp_date
         , x_join_club_date
         , x_membership_ky
         , x_address1
         , x_address2
         , x_city
         , x_state
         , x_zip
         , x_delivery_route
      from ( select x_first_name
                  , x_last_name
                  , x_middle_name
                  , x_membership_id
                  , x_associate_id
                  , x_member_ky
                  , x_member_exp_date
                  , x_join_club_date
                  , x_membership_ky
                  , x_address1
                  , x_address2
                  , x_city
                  , x_state
                  , x_zip
                  , x_delivery_route
                  , count(*) over (partition by x_address1, x_address2, x_city, x_state, x_zip) cnt
               from canceled_customers
           )
     where cnt > 1
    

    Note: not tested.

    Kind regards
    Rob.

  • Firefox takes a long time to close since a recent update and memory of pigs.

    Since the recent updates that have begun to use containers of plugin, Firefox takes a long time to close. If I try to go back there, he said that it is still running. I have liik in the Manager of tasks and about seven containers plugin. exe is running, and I turned off or disabled mostplugins and addons, same Quicktime. Firefox uses an obscene amount of RAM on my XP machine and rendered sluggish. I use XP SP3. This started after you added the plugin container in one of the recent updates earlier in the year. For the features it offers me or does not offer me, instead, it uses far too much RAM and is too slow. And takes a long time to close when I close the browser. It uses about twice as much RAM as it was.

    Upgrade your Firefox 9 browser and check

  • Pages take a long time to load in versions 6,7 and 8, version 5 works fine.

    Version 5 works fine, when I updated to 6.7, and now 8, pages take a long time to load. It's on 2 different computers, one with Vista, Windows 7 other. If I restart Firefox it helps, but the problem comes back. Does not happen with IE or Opera.

    The default value of the pref Network.http.Max - connections has been increased from 30 up to 256 in versions of Firefox 6 +.

    Try to decrease the value of the pref Network.http.Max - connections 256-30 such as used in versions of Firefox 3.

    One possible cause is security software (firewall) that blocks or limits Firefox or plugin-container process without informing you, possibly after the detection of changes (update) for the Firefox program.

    Delete all rules for Firefox in the list of permissions in the firewall and leave your firewall again ask permission to get full unlimited access to the internet for Firefox and the plugin-container and the update process.

    See:

  • The system preference takes a long time to load

    As the title suggests, end of 2013 (10.11.4) System Preferences on my iMac takes a long time to load, even after a fresh reinstall and/or reboot (tried both). It takes about 20 seconds to one minute each time to open (except when I close it and immediately open it once again, as it is always loaded in memory). This problem existed only after the upgrade to El Capitan, and I saw many other people with iMacs with the same problem. I tried to remove cache for before system preferences files, but that did not help at all. I don't have a FileVault if it makes a difference, even if I did before reinstall, but never turned back (persistent question anyway). Any recommendations would be useful. Thank you!

    Data sheet:

    iMac (end 2013)

    Intel Core i5 at 2.7 GHz

    8 GB 1600 MHz DDR3

    1 TB 5400 RPM HARD DRIVE

    Intel Pro Iris 1536 MB

    I found it is the State of affairs in 10.11 if running a HD spinning.  Don't feel alone.

    I suspect that it is a function of low priority in the memory compressed algorithm.

    Upgrading to an SSD and it will rise to attention.

  • Satellite M300 PSMDCA takes a long time to start

    I have a Toshiba Satellite M300 PSMDCA - 01800C and there are some problems with it.

    First of all, when you start the computer, it takes a long time to start and activate Outlook.
    I am running Windows 7Home Premium.
    Computers arrow where I bought the computer told me that it can take up to three hours to go back through each process at startup?

    Is it normal that all I wanted was a simple portable easy fast, but it seems that I am stuck again.

    Also, when I go back to the computer, even after some time the mouse it does not provide new and pushing the Start button just a blank screen. Alt + Ctrl + delete, then he activates Windows again and then after having put my password and I have to wait for that be again loaded everything that takes so long. Any ideas?

    Also I often get the message when the computer starts "error has occurred in Toshiba PC Health Monitor. He will leave the application. "Main.frm.cpp (184). Any ideas?

    Quite often when I am scrolling with the mouse, the screen will turn black and flash and a message «the NVIDIA display driver... couldn't Reg...» "and he will correct itself after awhile. Frustrating!
    Quite often when scrolling on the websites of the page I'm going to freeze?

    I use MS Office 2010 and there is a problem trying to save Word documents and a message comes up with "a file permission error.

    Any thoughts? Thanks, Shirl51

    > First of all, when you start the computer, it takes a long time to start and activate Outlook. I am running Windows 7Home Premium. Computers arrow where I bought the computer told me that it can take up to three hours to go back through each process at startup?

    This nonsense!
    The system should boot up quickly my laptop needs 30 seconds to start.
    In my opinion, the system is screwed

    In your case, I recommend to reinstall the system.
    Did you create the recovery disk?
    If this isn't the case, I think that detailed instructions should be placed in the user's manual.

    After the recovery of disk has been created, restore the system, BUT save the data before doing so because the recovery disk would be to format the HARD drive and you lose data!

  • My 3rd generation takes avery long time to load, is this normal?

    My 3rd generation I - pad takes a long time (hours) to load.  Is this normal, or should I consider service?

    Hello

    Make an appointment at apple store for a battery check

    They can offer an out of warranty repair / replacement

    But you have to pay part of the cost.

    See you soon

    Brian

  • Visual Studio 2008 Pro takes a long time to start after the installation of measurement Studio 2009

    After installing Measurement Studio 2009, I noticed that it takes a long time (30-60 seconds) to open a Visual Studio project.

    I do not have an internet connection on my development computer and suspect he might be waiting on some kind of operation of the network to time out.  I had problems with Visual Studio in the past as well and had to work around them by adding entries to my hosts file (to redirect some addresses of Microsoft to the local IP address - this causes network operations to expire immediately).

    Just curious if anyone has encountered this kind of slow startup time and found a solution.

    Thank you!

    I found an article referring to a question similar to MS 8.1.  I don't know if the problem has simply not been corrected or why I am still having this problem.  Workaround "per computer" listed in the article solved my problem.

    http://digital.NI.com/public.nsf/allkb/18E25101F0839C6286256F960061B282 I have

  • XY graph sometimes takes a long time to update legend

    Hello

    I wrote a small piece of code that highlights (changes line width) the plot on the graph when we click a mouse on its name in the legend of the plot. The code works well except when I the legend scroll bar is visible and its position is not 0, then when I click on the name of the parcel, the chart takes a long time(>4s) to change the width of the plot on the legend. The plot on the graph is updated instantly. Its only the legend of the plot that takes a long time to get updated.

    I enclose the code here... Please, run it and see if you also see the same behavior.

    Thank you

    Ritesh

    Hi Ritesh,

    The patch of f2 is already released. http://www.NI.com/download/LabVIEW-development-system-2015/5656/en/

    We will inform you of the R & D of your first question, but unfoturnately we cannot provide information on future products releases.

    Kind regards

  • videos take a long time to buffer

    There are a few dat I could watch fine Inc. and now it will take a long time for the buffer viedo and still have problems

    Hello

    1. what operating system is installed on the computer?

    2. what version of web browser work?

    3. do the same thing happens with all the videos that you try to play?

    4. I think you are referring to the videos online?

    5. How do you try to play the video?

    If you use Internet Explorer and facing problems, watch videos online, then you can check out the link below:

    The video problems when you use Internet Explorer

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

    Note:

    There is no option within the operating system to increase the speed of buffering. Only way to increase the speed of buffering in some measure is to have a connection with a higher bandwidth. But note that as does you not an option of continuous play in CD or DVD.

    Another work around that I do personally is to pause the video to complete the buffering and watch the video once the buffering completed.

    I hope this helps!

  • desktop computer takes a long time to load after uninstall of netware

    Dear Pascal, recently, by chance, I installed the client service for Netware on my PC. He asked to restart the computer, and after reboot, logon screens became classic. I uninstalled netware by accessing the properties of LAN. I managed to restore logon screens using Microsoft resources available on the net. However, my PC now takes * for long time for the desktop icons and toolbar are displayed. I use Microsoft Windows XP Version 2002 SP3, Intel Core2Duo processor P8600 @2.40 Ghz with 2 GB of RAM on Lenovo Thinkpad R400. I understand that it is after uninstalling the netware client that my office is very very slow. Help me for a faster loading of the desktop computer. Best regards, Reba Shankar

    Hey Reba,

    Thanks for choosing Microsoft Community!

    You have reached the right forum. Try to solve this problem.

    If I understand correctly, you have some performance issues on windows XP computer.

     

    Let us try the following steps:

     

    Method 1: Any installed program must be uninstalled from Add and remove programs. You can just remove shortcuts from other places like LAN properties.

    Run the following fix - it to uninstall client services for Netware.

    Solve problems with programs that cannot be installed or uninstalled:

    http://support.Microsoft.com/mats/program_install_and_uninstall

     

    Method 2: See the following article:

     

    How to make a computer faster: 6 ways to speed up your PC:

    http://www.Microsoft.com/atwork/maintenance/speed.aspx#fBid=uQRRD6ZPxkC

     

    Important notes:

    ·         Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data can be lost.

    ·         The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Hope the helps of information. Don't answer if you need assistance, we will be happy to help you.

Maybe you are looking for