Hacker News new | ask | show | jobs
by globular-toast 5 days ago
> It takes just as much work to delete a row as it takes to insert a row. Why wouldn't it?

Because your data structure/algorithm supports fast deletes? File systems support deleting entire directories instantly. I'm not aware of any fundamental reason why DELETE in a SQL database must take as long as an insert?

3 comments

I usually don't like the "read the article" replies, but in this case it's warranted - the second section explains how multiple transactions interact there, and the "deleted" record still needs to actually exist for older transactions.
> File systems support deleting entire directories instantly.

What file system supports this? I’ve never experienced the joy of deleting an entire large directory and seeing it disappear instantly.

I’m not sure how this would work with any modern file system that supports basic notions like hard links.

I suggest you read the following sentence of my comment, the one after your quote. It provides your answer.

And file systems deleting huge directories instantly is the equivalent of DROP TABLE here, which I also mention in my comment.