How to reduce time while deleting more than 300K records ?

Hi,
I am using SQL SEVER 2008 R2. I've a doubt, if there any possible to reduce executing time while deleting  more than 3 lakhs records. I will explain about the table structure. Table_Name : test. In that table have 15 Columns , 6 Indexes ,Foreign and
Primary Key releationships. 
Query :  DELETE FROM test WHERE roleid=1      [roleid is not primary key]
Message: (308240 row(s) affected) 
Time : 28 seconds.
Cheers,
RAM BHARATH

Hi,
I am using SQL SEVER 2008 R2. I've a doubt, if there any possible to reduce executing time while deleting  more than 3 lakhs records. I will explain about the table structure. Table_Name : test. In that table have 15 Columns , 6 Indexes ,Foreign and
Primary Key releationships. 
Query :  DELETE FROM test WHERE roleid=1      [roleid is not primary key]
Message: (308240 row(s) affected) 
Time : 28 seconds.
Cheers,
RAM BHARATH
I suppose Roleid has index on it ?. 3 lac records getting deleted in 28 sec i think its ok as delete operation takes exclusive lock .Exclusive lock is not compatible with other locks so some delay might be expected 
You should check blocking process if any by using sp_who2 to see if your process is waiting on any resource or is blocked by some other SPID.
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Similar Messages

  • How do I delete more than 1 bookmark at a time

    I have a gazillion bookmarks, how can I delete more than 1 at a time?

    '''Bookmarks sidebar -- Multiple selection:'''
    To select the first item in the bookmarks sidebar without invoking it, you must click to the '''left''' of the favicon (and to the left of the expand indicator in the case of folders). To add another item again select in the same manner but with Ctrl+click.
    To extend a selection from the last selected item hold the Shift key and you can click anywhere on the item's row to extent to there,
    '''Library List (both Bookmarks and History)'''
    Since it take a double click to invoke the bookmark or history page, it doesn't matter where you click on the line item it only selects it.
    '''If that fails''', which you seem to have indicated that it does...
    :then it would seem that you have installed some extension to make it so that you do not have to double-click in the library list. What extensions do you have with "Bookmark" and/or "click" in their name?
    Would you try the above instructions while in "[http://kb.mozillazine.org/Safe_Mode Safe Mode]".
    In current versions of Firefox, Thunderbird, and SeaMonkey 2, you can restart in Safe Mode via "Help ("Alt+H") -> Restart with Add-ons disabled...". A Safe Mode options window will appear when they restart.
    Do not make any changes to the options, just click the "Continue in Safe Mode" button. Clicking on anything else would cause permanent changes (damage).
    In Safe mode your extensions are temporarily disabled and will be active again on the next restart.

  • How do I delete more than 1 email at a time in my inbox - on my iPhone or iPad?

    How do I delete more than 1 email at a time in my inbox - on my iPhone or iPad?
    I've tried "marking" them - but can't move to trash?

    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
     Cheers, Tom

  • How do you delete more than one photo at a time on Iphone 3gs camera roll?

    How do you delete more than one photo at a time on the Iphone 3gs camera roll?

    You can't.

  • How do I delete more than 1 slide at a time from the custom slide show in Elements 8

    How do I Delete more than 1 slide at a time from the custom slide show in Elements 8?

    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
     Cheers, Tom

  • TS3899 How do I delete more than one email at a time from my i phone 5C

    How do I delete more than one email at a time from my i phone 5C

    With your Mail app open and the listing of the messages, tap Edit at the top right.  Then check each circle on the left side of the messages to delete.  When you have checked those to delete, tap Trash at the lower right.
    Next tap Mailboxes upper left, under accounts select the account, then for the account tap Trash.  Select Edit upper right, and at the bottom, Delete All, and confirm Delete All and all will be removed at one time.

  • How to delete more than 1 contact at a time

    I need to know ASAP how to delete more than one contact at a time

        Hello grams4crew!
    I can definitely help you in deleting more than one contact at a time, no problem! I hope you're enjoying your Galaxy S5!
    You can delete a single contact, or choose multiple contacts
    to delete.
    1. From the Home screen, tap Contacts.
    2. Touch and hold on a contact to select it. You can also
    tap other contacts, or choose Select all to select all
    contacts.
    3. Tap Delete, and then tap OK to confirm.
    We have a page for our customers to get the user guides for their devices: http://vz.to/1oMIe2y
    I hope this helps!
    Thank you,
    ChristinaB_VZW
    VZW Support
    Follow us on Twitter @VZWSupport

  • HI, could anyone please tell me how you can delete more than 1 photo at a time or ipad or ipod touch?

    HI there, could anyone please tell me how you can delete more than 1 photo at a time on ipad and ipod touch??

    Delete multiple pictures at 1 go.
    1. Click the box with arrow on top right of Album.
    2. Select pictures to delete
    3. Tap Delete
    http://i1224.photobucket.com/albums/ee374/Diavonex/86e1a2c37a805bca2ccacc66c95ce 934.jpg

  • How can I delete more than 1 email at a time

    How can I delete more than one email at a time?

    Select multiple emails and click Delete button.
    Then empty trash in the Mail application.
    How to select multiple items?
    http://support.apple.com/kb/PH13826
    Best.

  • How to delete more than one photo at a time

    Apparently there is no longer an iPhoto trash. So you don't drag photos to the trash. Instead you hit the delete key and then a second click on delete when you get the message "Are you sure you want to delete this photo." Has anyone found a way to delete more than one photo at a time, though? This is really a hassle if you have just imported 500 photos and are going to end up deleting 450 of them.

    I didn't say use the command key and delete. I use the command key for selecting random photos. Then I right click and choose delete from the contextual menu.
    I always use right click, but the command-delete does work also in that album.
    Depending on what album you are in, there are different menus. In a user created album, the right click would show "Remove from Album" & "Delete Photo". I noticed that was the same for Last Import Album. But at the same time, under image, you will only have Remove from Album. If it is a system album, you will only get the delete menu from either the right click or from the menu under Image.
    What you have to remember is if it days delete the photo, it will completely delete it from the library and all albums. If the menu says Remove From Album, then it will only be removed from the album you are in.
    In PhotoStream Album, you get only Delete Photo from the right click menu, but under image, you get only remove from album. So if you want to remove an image from PhotoStream, you have to use the top menu so it won't get deleted from the library. If you want to remove a photo completely, you would use delete and it will be removed from the library and photo stream.
    So, there are different processes for the different albums. I don't know if that is intentional or just oversight. That may change in the future.

  • How to delete more than one picture at one time in iMovie?

    In the timeline, can I delete more than one picture at one time, or do I have to right click and choose delete entire clip for each picture? I tried to select one (so that there's a yellow bracket) and then shift and choose the last picture (so all are now surrounded by yellow bracket), but when I right click and choose delete entire clip/ delete selection, only the first picture is deleted..
    Is there a way to delete more than one picture at one time?

    After selecting all the pictures, simply hit the Delete key on the keyboard.
    John

  • How do i delete more than 50 emals at a time

    i want to delete more than 50 emails on me account

    hello, please see [[Problems with email and how to find help]]

  • HT4207 how do i delete more than one email in ios7

    How can I delete more than one email at the same time in ios7?

    Select Edit at the top in the left hand pane, tick the small circle against each email you wish to delete,  select trash at the bottom of the left hand pane.

  • Is there a way to delete more than one photo at a time in the Photo application?

    Is there a way to delete more than one photo at a time in the application Photos in the iPad? Thanks.

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • How to delete more than one workbook from command line

    Hi, I'd like to delete more than one workbook from command line:
    The following syntax, it doesn't work....but I followed the manual instructions:
    dis51adm.exe /connect eul/eul@uatdb /delete /workbook "ALE_TEST_1, ALE_TEST_2" /eul eul /log D:\Ale\delete.log
    where:
    eul/eul@uatdb: is the db’s schema/user where the EUL is installed;
    /delete "ALE_TEST_1, ALE_TEST_2": is the command to delete the workbooks, specified inside the “” (with the relative path)
    /log D:\Ale\delete.log: is the command to write a log’s file named “delete.log” to track the action     
    The log file says:
    22/4/2008 4:00:26 μμ
    dis51adm.exe /connect /delete /workbook ALE_TEST_1, ALE_TEST_2 /eul eul /log D:\Ale\delete.log
    Document ALE_TEST_1, ALE_TEST_2 not found in EUL.
    Internal EUL Error: ObjectNotFound - Can't find EUL element
    There are 0 eul elements to be deleted.
    Completed deleting eul elements.
    22/4/2008 4:00:29 μμ
    Anyone can tell me how is the right syntax ?
    Thanks in advance
    Alex

    Hi Rod
    I was coming to that conclusion myself but wanted to wait until the other avenues had been exhausted first - aka making sure of the workbook names.
    I checked through all of the command line documentation and read nothing which clearly indicated that only one workbook could be processed at a time, other than the fact that the syntax says workbook and not workbooks, which could be a big clue.
    I think you are right though in that it has to be one at a time, which would be a pain.
    Best wishes
    Michael

Maybe you are looking for