Delete statement in SQL is very slow

前端 未结 15 730
自闭症患者
自闭症患者 2020-12-22 23:23

I have statements like this that are timing out:

DELETE FROM [table] WHERE [COL] IN ( \'1\', \'2\', \'6\', \'12\', \'24\', \'7\', \'3\', \'5\')
15条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 00:00

    Check execution plan of this delete statement. Have a look if index seek is used. Also what is data type of col?

    If you are using wrong data type, change update statement (like from '1' to 1 or N'1').

    If index scan is used consider using some query hint..

提交回复
热议问题