DELETE command locking system

  • I support a third party application where an end user will execute something from the app and the following sql is run...

     

    delete from table1 where col1 = '1234' and col2 = 'A'

    The table only has 10,000 rows and the statement takes about 5 minutes to run and causes blocking throughout the whole server. Does this make sense?

     

  • If it's a third-party application you may not have a lot you can do without invalidating any support you've purchased. I'd contact your vendor about it first.

    Delete operations will lock and then check constraints before performing the delete. If the table is involved in a lot of different constraint relationships there could be issues. Also if you have triggers, the transaction (and lock) can be held while the triggers execute. Cascading deletes could also be an issue.

  • I'd also suggect checking the limiting columns are preoperly indexed as well as any column used in the join.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply