Instead of having one Datetime column to handle soft deletion, I would use two columns .
ColumnName Data Type
Deleted BIT DEFAULT(0)
DeletedAt DateTime
And create a Filtered Index on the Deleted column something WHERE Deleted = 0
.
The reason is, data with soft deleted rows we mostly only return Active/Non-Deleted rows. Hence each time you return rows sql server can look at the filtered index on the smallest data type (bit being 1 byte) and do less data processing.
And if you ever want to know when a record was deleted , DaletedAt column is there to store that piece of information.
On the other side If you only have ONE Datetime Column to to handle soft deletion, Your Filtered index would be something like WHERE DeletedAT IS NULL
, now in this case SQL Server will be querying 8 Bytes of data just to check if a row is Active or not. In this case you are doing 8 times more data processing as compare to a BIT column just to get the same results. Sounds bad doesnt it :).
Hence my recomendation would be Add another Bit column , and a filtered index on that bit column to handle soft deletion. Leave DeletedAt column to handle only delets.