Delete statement in SQL is very slow

前端 未结 15 704
自闭症患者
自闭症患者 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
    2020-12-22 23:56

    If the table you are deleting from has BEFORE/AFTER DELETE triggers, something in there could be causing your delay.

    Additionally, if you have foreign keys referencing that table, additional UPDATEs or DELETEs may be occurring.

提交回复
热议问题