4 ms·
UPDATE client set enabled = true; So something like this will rewrite the whole table because of MVCC. MySQL will update the record in place without rewriting
by dk8996 9y ago
UPDATE client set enabled = true;
So something like this will rewrite the whole table because of MVCC. MySQL will update the record in place without rewriting the whole table.
- mst 9y agoMVCC is almost always a feature for my workloads but it's well remembering it's a trade-off. Thanks for reminding HN of this point.
- eloff 9y agoMyISAM I assume? InnoDB, which I hope you're using, uses MVCC too, just like pretty much all mainstream SQL databases of the last 30 years. Updates occur in place, with the older version of the columns relocated to UNDO space. Not sure what you're gaining over PostgreSQL there. Also, if the column is indexed, the index will contain all versions for each row. This is what allows index scans.
- deleted 9y ago[deleted]
- riku_iki 9y agoBecause FS operates pages, and not individual bytes, MySQL will also, for each column, read whole page with row included, and write it back, thus rewriting whole table..