Tech
MVCC Explained: Build Postgres-Style Snapshots in 100 Lines of TypeScript
Open two psql sessions.
Session A:
BEGIN ;
DELETE FROM users ; -- deletes all 1 million rows
-- don't commit yet
Session B:
SELECT count ( * ) FROM users ;
-- count: 1000000
Session A deleted every row. Session B sees every row. Neither session is waiting on the other. No locks, no blocking, no errors.
So... where are the rows? Deleted, or not?
The answer is both , and by the end of this post you'll have built the m...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to