4 ms·
MySQM? MySQL presumably? Anyway MVCC is implemented via locks (among other things, like copying, transaction ids, visibility maps, etc). Regardless of that,
by calpaterson 6y ago
MySQM? MySQL presumably? Anyway MVCC is implemented via locks (among other things, like copying, transaction ids, visibility maps, etc).
Regardless of that, my main point is that even reading requires transactional bookkeeping in the database - which some people don't realise. If you read a row and, do nothing and then rollback a few ms later (common in webapps) there is still bookkeeping to be done.
- spacemanmatt 6y agoBut it shouldn't result in a write to disk unless a page is dirtied.
- calpaterson 6y agoI wasn't talking about writes but as an aside: I wouldn't bet on that. SQL databases are complicated and writes can happen for many reasons - if you manage to bloat the working set by reading more stuff concurrently (old rows, etc) it's not hard to imagine something having to be paged out as a consequence.
- spacemanmatt 6y agoQuite agreed. It's still way harder and way less frequent for read activity to force much write activity, although not hard to imagine.