I have a table with more than 20 million rows, and when i do:
DELETE [Table] WHERE ID = ?
It takes over 40 seconds. The ID column is clustered.
Is this what you could expect? or is it possible to optimize this?
In addition to the fine points JNK included in their answer, one particular killer I've seen is when you're deleting rows from the referenced table for one or more foreign key constraints, and the referencing column(s) in the referencing table(s) aren't indexed - you're forcing a table scan on each of those tables to occur before the delete can be accepted.