Delete statements very slow

hi,
We have a performance issue the delete statements on the database are running very slow they are taking about 12 hours.
the delete statements are like
DELETE table_name
WHERE column1 = 'temp'
AND col2 LIKE 'A%'
AND col3 = 0;
that table has an composite index with 5 columns and the columns specified in the delete statements are in the order
column1 position 4
col2 position 3
col3 position 5
no additional indexes are present on the table

As already suggested get an execution plan for the deletes to see what it is doing to make informed decisions about what to do.
Until then ...
You said you have one index on 5 columns
WHERE column1 = 'temp'
AND col2 LIKE 'A%'
AND col3 = 0;
that table has an composite index with 5 columns and the columns specified in the delete statements are in the order
column1 position 4
col2 position 3
col3 position 5Oracle might be doing a skip scan on the index or a full table scan - it is possible neither is efficient for your operation. An index ordered by # of unique values (most unique first) on column1, col2, col3 might help performance on this delete if a small percentage of rows are being deleted (anywhere from 5% to maybe 30%, it depends). If a large percentage of rows are being deleted then a full table scan might be better.
If you have the license and the database is set up for it parallel DML is a possiblity - check the on-line documentation to see how to do the delete in parallel.

Similar Messages

  • Very slow going from email to email and also deleting is very slow?

    when I drop down to next email it is very slow and when I delete or open emails it is very slow??? It happen on desk top at home and laptop when I am away from home so I don't think it is the computer(s)?

    well, during internet rush hours, for example, from dusk to mid-night, monday to friday, it is really common there. you can try some alternative there, I.E. 7/8/9, google chrome 10.x to have some test.

  • SQL in statement very slow any help please

    Hi guys forgive me if i dont give enough information we dont normally have many problems with slow queries as our data does not usually get to a level that is effected by speed.
    I have a query that does a search of a view with approx 30k records. I then use a connect by to find all the relevent records that apply to this scenerio and place the results into an oracle form.
    I have hard coded an example ('ACT' and 6089) into this code, but usually the numbers/code will be a parameter thats passed in.
    Individually the select itemcode,notes from v_allitems takes approx 0.1 seconds to run
    and the IN statement takes approx 0.007 seconds to run.
    Together they take over 6 seconds which is a little too slow. So i assume its the IN thats causing me the problem as i am returning over 100 records to search IN. Is there an alternate way other than IN that anyone can think of to achieve the desired result?
    Thanks in advance
    select ITEMCODE, notes from v_allitems
    where ITEMCODE = ( 'ACT'||','||6089) OR ITEMCODE IN
        (SELECT pcchildcode
          ||','
          || pcchild item
           FROM afpc
          CONNECT BY pcparent = prior pcchild
        AND pcparentcode        = prior pcchildcode START
        WITH pcparent           = 6089
        AND pcparentcode        = 'ACT'
      UNION ALL
         SELECT pcparentcode
          ||','
          || pcparent item
           FROM afpc
          CONNECT BY pcchild = prior pcparent
        AND pcchildcode        = prior pcparentcode START
        WITH pcchild           = 6089
        AND pcchildcode        = 'ACT'
        )

    I have just found another thread talking about the EXISTS condition, ill look into whether this will speed it up

  • The latest issue of Pages for iPad: 1. Very slow. 2. Late in reacting to typing. 3. When I go to a specific file, informs me that some images were deleted and therefore file has been changed. Then when OPEN option used, opens file slowly. Please, help!

    What I have to do to correct the following problems with Pages app. For iPad:
    Hesitates to display results of typing, some times for 5-6 characters;
    Very slow in opening files;
    Before opening of a specific file displays message: DOCUMENT DETAILS. SOME CHANGES WERE MADE TO YOUR DOCUMENT. SOME IMAGES ARE MISSING BECAUSE THEY WERE DELETED FROM YOUR DOCUMENT. We'll, nothing is missing. But it takes forever to open this file. The previous issue of Pages worked very good. But they would not let me to go back to it. Please, help!

    Tmobile did the exact same thing to me. So that is customer service at work in general. Nice try though lol.
    To the OP
    I see you said You paid for shipping, did you Insure it? Claim insurance on it. If you did not, It may not be Verizon or your fault in the sense of the phone not making it to the warehouse. There are people out in the postal world that will steal phones that are not insured. It could have been a Verizon employee, i suppose.
    But, if this was to be a bought in court, if you shipped it with out insurance, sadly your at fault.
    Do you still have the Serial number of your old phone? If so, you should be able to track where your phone is (if it is reported as a defect/damaged) If so, you may be able to use that as proof. If it does not show up as a defect or what ever they determine use as a loss, then you know it did not make it to the warehouse to be checked in. I would suspect Apple or Verizon could tell you what the Serial number came up as.

  • My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Help!

    My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Please help !!!!

    Thank you very much for your reply gdgmacguy :) I did all you suggested apart from restore as new device . Didn't know I could do that . After restore I did restore from back up only,  as I didn't want to end up without contacts details on my phone. If I restore as new device how do I get my all contacts? Still will have to use back up? Sorry if it sounds like I don't know what i am doing, i just have no one to ask who would know. Thank you

  • In some mailboxes, very slow opening/deleting emails. In other mailboxes it works just fine

    In my inbox, very slow opening some (not all) emails. To delete the problem emails takes 40-50 seconds. Also, I keep marking many emails as "junk" and yet I keep getting maile from those spam senders. Also, these problems happen in some of my local folders, but not in all of them?? Had no problem with prior version

    Are you using McAfee anti virus by any chance?

  • VERY Slow Responses in iTunes When Deleting

    Hi,
    Can anyone help me with a problem of VERY slow responses in iTunes when I try to delete or amend track information. For example when I click on delete it can take several seconds or more to respond and again when I confirm the deletion or amendment.
    I have had this problem for some time now and still occurs after a full re-install of the operating system (Leopard 10.5.8 on a PowerMac Quad processor and iTunes 10.6.3) All the remaining applications work fine just as they should do.
    Blackrockguy

    Does anyone have an answer for this question? Is there perhaps some outside plug-in that can help?

  • I am using Thunderbird 24.4.0 and it is very slow in loading emails and deleting emails. Did not have this problem till recently. Running Windows 7

    With in the last 3 days my emails have been very slow to open and it takes about 20 secs. to delete an email.
    At times I see the message that Thunderbird is not responding. I am using Windows 7 and Bitdefender AV.
    I closed the firewall on the AV and this did not change anything. Any help will be greatly appreciated

    Disable Bitdefender's option to scan mail folders and see if the performance improves.

  • After upgrade to IOS8, uninstall/delete an app is very very slow

    As the title said, it was very very slow to delete an app after upgrade to IOS8.1 for my iPad air.
    That not good for Apple style,please fix it asap.
    Lei

    Hi Try a Reboot press & hold power button & menu button hold both down until you see Apple Logo If this doesn't fix your problem Do a Factory Restore this will get rid of some bugs And iPad will be like new Do a backup to iCloud before doing this Make sure you use the same Apple ID I did this last week on iPad Air Running 8.1 It's just like new now very quick Cheers Brian

  • I am deleting 44,000 files; why is it so very slow to do this chore?

    I am deleting 44,000 files; why is it so very slow to do this chore?

    Could something from Bitdefender be activated somehow and slowing my computer down?
    Yes. Back up all data, then uninstall "Bitdefender" completely according to the developer's instructions -- NOT by dragging an application to the Trash or hunting for files by name.

  • Having mail problem very slow opening, deleting, unable to move to folders

    Have a 2 GHz Intel Core Duo Mac OS X Ver. 10.6.8 - Having AppleMail problems: very very very slow opening any new incoming mail, can't delete, can't assign to Spam, and can't move to any folder for storing, and can't empty trash.  Seems to be corrupted and might need to reload the Mail Program (Version 4.6) and need to know if I can reload the mail program  and if I did would I lose all the data stored in folders?  I don't know how to reload the Mail program.  Also the entire computer seems to be slow to react as well but mail is worse.  I've checked and emptied caches for the browsers I use.  Connecting to Internet all right but as I said, slow to react.  I would appreciate any advice. Thank you.

    MichelPM, I don’t know how to find out how full is my Mail app.  I confess to being mostly an ignoramus about computer hardware, software, applications storage and usage.  I know where to look for some stuff, but I don’t know what all the information means.  I found the page under About this Mac Serial-ATA that gives the following info:  Macintosh HD:
      Capacity:          319.73 GB (319,728,959,488 bytes)
      Available:          270 GB (270,003,339,264 bytes)
    Then under Memory Slot there are two banks in Bank 0 all categories are empty but Bank 1 says 
                        Size:          1 GB
        Type:          DDR2 SDRAM
        Speed:          667 MHz
        Status:          OK
    I usually have three browsers open and one to two wordprocessers (Word and TextEdit),  the resident Dictionary.  When needed but closed when done with the current activity are Preview, Adobe Reader.  I do have a lot of documents on the desktop and filed in folders are uncountable.  I could commit most of these to flashdrives if I have to, but I’m not sure how to save all the stuff I have in folders in the Mail app.  I do not run any antivirus or “crapware” software that I can find in the MacHD applications folder.  I’ve never downloaded such programs.  I will commence to copy to external drives data I wish to preserve.  Can I copy the entire mail set of archive folders to an external hard drive?  I have a La Cie.
    With much appreciation for any help you offer,
    MMarvelous

  • What does 'include render files' option mean for when I duplicate a project. I deselected it and the duplicated file is very slow so maybe this has affected it. It's a shame cause original project is deleted. Have I lost the rendered files? Thanks

    What does 'include render files' option mean for when I duplicate a project. I deselected it and the duplicated file is very slow so maybe this has affected it. It's a shame cause original project is deleted. Have I lost the rendered files? Thanks

    Yes, if you duplicate without the render files and delete the original project you lose the render files. But render files get recreated - automatically if you have it set in the preferences (which is the default option). It just takes time.

  • Wastebasket on my MBA is VERY slow to delete...

    Lately I've noticed that my "waste basket" is VERY slow to empty.  As I remember, until recently, when I emptied the waste, the "gas gauge" rapidly moved from left to right.  Now it crawls VERY slowly.  Almost like it's doing a 3 pass write over.  Anyone else notice this?
    I have 65GB of free space if this is a factor.
    Running Lion 10.7.3
    MBA 128GB SSD

    Matthew Morgan wrote:
    Let us know.
    Matt
    I guess unchecking "Empty trash securely" took care of this problem.  I put a bunch of stuff in the waste backet, then hit empty and it "swallowed" the whole load in one big gulp.  Thanks for the tip Matt!
    I realize the detete files can be recovered by a super techie, but there is nothing on my computer would worry me if the files were recovered.  And I'm thinking this "empty trash securely" might preclude them from being recovered if push came to shove.

  • Delete very slow in the DEV setup

    Hi All
    I am running a following query in the 10g Enterprise Edition Release 10.2.0.2.0 (Development setup) which deletes the Approx 91 lakh records from the Master table and re-insert the modified data in to same table it takes around 40 Hrs to complete. The table is analyzed and indexes are rebuild just before the query runs. i do have a another set up(UAT) with the same configuration as that of DEV setup in which same task get executed in 1.5 Hrs(MAX). The DB parameters are also same. Also UNDOTBS and TEMP tabelspaces are of same size. i have done the OS level analysis also but found nothing wrong.I don't uderstand why this happening. i am mentioning the Query and explain plan for your reference .
    **Query**: DELETE FROM FCT_NON_SEC_EXPOSURES WHERE FIC_MIS_DATE = TO_DATE(20090331,'yyyymmdd') AND V_RUN_TYPE = 'B' AND N_RUN_SKEY = 6 ;
    Explain Plan:
    Operation     Object Name     Rows     Bytes Cost           
    DELETE STATEMENT Optimizer Mode=ALL_ROWS          9 M     240694                     
    DELETE     FCT_NON_SEC_EXPOSURES                                   
    TABLE ACCESS FULL     FCT_NON_SEC_EXPOSURES          9 M 3G     240694
    Plan is same on both setups.
    Hardware COnfig of both servers
    16 GB Ram,2 Dual core CPU AIX OS
    Pls suggest things i can look to improve the perforamance.
    Thanks in advance.

    Hi
    You can also check for missing referential indexes of that table with the below query.
    creating the missing referential indexes will also increase the performance.
    select decode( b.table_name, NULL, '****', 'ok' ) Status,
    a.table_name, a.columns, b.columns
    from
    ( select substr(a.table_name,1,30) table_name,
    substr(a.constraint_name,1,30) constraint_name,
    max(decode(position, 1, substr(column_name,1,30),NULL)) ||
    max(decode(position, 2,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position, 3,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position, 4,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position, 5,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position, 6,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position, 7,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position, 8,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position, 9,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position,10,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position,11,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position,12,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position,13,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position,14,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position,15,', '||substr(column_name,1,30),NULL)) ||
    max(decode(position,16,', '||substr(column_name,1,30),NULL)) columns
    from user_cons_columns a, user_constraints b
    where a.constraint_name = b.constraint_name
    and a.table_name in ('*TABLE_NAME*')
    and b.constraint_type = 'R'
    group by substr(a.table_name,1,30), substr(a.constraint_name,1,30) ) a,
    ( select substr(table_name,1,30) table_name, substr(index_name,1,30) index_name,
    max(decode(column_position, 1, substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 2,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 3,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 4,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 5,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 6,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 7,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 8,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position, 9,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position,10,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position,11,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position,12,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position,13,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position,14,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position,15,', '||substr(column_name,1,30),NULL)) ||
    max(decode(column_position,16,', '||substr(column_name,1,30),NULL)) columns
    from user_ind_columns
    group by substr(table_name,1,30), substr(index_name,1,30) ) b
    where a.table_name = b.table_name (+)
    and b.columns (+) like a.columns || '%'
    Thanks
    Hariharan.T

  • Simple FORALL statement but runs very slow

    Hi Guys,
    I'm new to Oracle and I start to use it with .NET application. I have to collections that I want to pass as Associative arrays to PL/SQL procedure and want to update a table based on values on those collections but it runs very very slow 10 minutes for only 1000 record.
    here is the code
    .NET
                    OracleCommand cmd = con.CreateCommand();
                    cmd.CommandText = COMMAND_TEXT;
                    cmd.CommandType = CommandType.StoredProcedure;
                    var memberNoParam = new OracleParameter { ParameterName = PARAM_MEMBER_NO, OracleDbType = OracleDbType.Varchar2, Value = memberNoArray, CollectionType =                                                          OracleCollectionType.PLSQLAssociativeArray };
                    var statusParam = new OracleParameter { ParameterName = PARAM_STATUS, OracleDbType = OracleDbType.Int32, Value = statusArray, CollectionType =                                                          OracleCollectionType.PLSQLAssociativeArray };
                    var siteIDParam = new OracleParameter { ParameterName = PARAM_SITE_ID, OracleDbType = OracleDbType.Int32, Value =                                                                                                                   GlobalizationConfigurationSettings.Current.DefaultLocale.SiteId };
                    cmd.Parameters.Add(memberNoParam);
                    cmd.Parameters.Add(statusParam);
                    cmd.Parameters.Add(siteIDParam);                               
                    cmd.ExecuteNonQuery();                      
                    contextTransaction.Commit();
    PL/SQL
    PROCEDURE P_UPD_STATUS (
    P_MEMBER_NO IN VARCHAR30_ARRAY,
    P_STATUS IN INTEGER_ARRAY,
    P_SITE_ID IN SITE.SITE_ID%TYPE)
    IS
    BEGIN
            FORALL I IN VALUES OF P_MEMBER_NO
            UPDATE DIRECT_DEBIT_MIGRATION_T
            SET
                STATUS = 1,
                STATUS_DATE = SYSDATE,
                LAST_UPD_BY = '13.10 SEPA Tool',
                LAST_UPD_DATE = SYSDATE
            WHERE SEPA_MIGRATION_ID = P_MEMBER_NO(I)
            AND SITE_ID=P_SITE_ID;   
            COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.PUT_LINE('PKG_ALERT ERROR: P_UPD_STATUS : ' || SQLERRM );
    RAISE_APPLICATION_ERROR (-20999, SQLERRM);
    END P_UPD_STATUS;
    I've been reading about FORALL from yesterday with no help. please advise

    I'm new to Oracle and I start to use it with .NET application. I have to collections that I want to pass as Associative arrays to PL/SQL procedure and want to update a table based on values on those collections but it runs very very slow 10 minutes for only 1000 record.
    If your array has 1000 records than this means that you do 1000 single updates - if those updates cannot benefit from a decent index access than this will be slow as hell. So as you've been told, check indexes, statistics and the performance of a single update.
    And perhaps you could rewrite your query as
            UPDATE DIRECT_DEBIT_MIGRATION_T
            SET
                STATUS = 1,
                STATUS_DATE = SYSDATE,
                LAST_UPD_BY = '13.10 SEPA Tool',
                LAST_UPD_DATE = SYSDATE
            WHERE SITE_ID=P_SITE_ID
                 AND SEPA_MIGRATION_ID IN (SELECT column_value from TABLE(P_MEMBER_NO));
    which would be one update processing 1000 rows rather than 1000 updates processing 1 row each.

Maybe you are looking for

  • IP Phone VPN connection to ASA using Anyconnect

    Hello, I will be configuring my first Anyconnect VPN to allow an IP Phone to connect over the internet.  I wanted to know what the best practice is in generating a certificate on the ASA...is self generating ok or get one from a CA?  What are the con

  • While initializing CUE , i get following error "kdb: Debugger re-entered on cpu 0, new reason = 5"

    HI all, I have  AIM-CUE(v 3.2)  on 2851 Router with IOS image Version 12.4(22)T4 (c2800nm-advipservicesk9-mz.124-22.T4.bin) with CCME version 7.0(1). I have been trying to make the Aim-Cue run and come up for initialization with every method I know o

  • ACE 4710 A3(5) Logging new connections

    We have recently transitioned one of our Ecommerce products to a new data center, at which we now use a one-armed load balancing approach rather then the routed load balancing approach we used previously. This is casuing us some issues as we generall

  • Interview Q in Implementation project ?

    Hello Masters,     Iam having an interview with "SAP INDIA"     kindly tell me what kind of Q they ask in IMPLEMENTATION        PROJECT.      Here are my responsibilities mentioned in CV. --> Extensive usage of Administration Workbench (RSA1). -->Dat

  • Servlet instance problem

    Hi I am have a web application that does a lot of processing. when 2 users submit the form.. i noticed that one instance of the servlet is running and the other request waits for some time for processor and just dies off.. Servlets are suppose to be