Y
Hacker News
new
|
ask
|
show
|
jobs
by
hapidjus
142 days ago
Are you asking why we wouldn’t use 'last_updated' to store when the record was deleted?
One reason is that you might want to know when it was last updated before it was deleted.
1 comments
nottorp
142 days ago
No, more like why you'd use a more expensive filter to hide soft deleted data, instead of just a flag.
link
masklinn
142 days ago
Checking whether `deleted_at is null` should be extremely cheap, and it avoids the duplication and desynchronisation of having both “deleted” and “deleted_at”.
link
nottorp
141 days ago
Yes, if your database has null. I know this is about postgres, but a lot of stuff is nosql now.
link
indigo945
141 days ago
Even in MongoDB, you can can index `null` values, so I don't understand in what database system this would be a problem.
link