Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I now thought that "updating a row" might be more expensive than simply deleting because UPDATE is implemented as "mark row deleted" + "insert new version of a row" in a table which support multiple versions of a row (MVCC). So maybe using DELETE is actually faster - it just marks a row as "deleted in transaction X". Unless I forgot something.


That's how Postgres' (and perhaps others) MVCC works, yes. MySQL / InnoDB, however, updates tuples in-place [0], and uses the undo log to recreate older versions as needed.

0: https://dev.mysql.com/doc/refman/8.4/en/innodb-multi-version...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: