
MVCC Unmasked (2011) [pdf] - Tomte
https://momjian.us/main/writings/pgsql/mvcc.pdf
======
ysleepy
It might help to imagine this as an implementation of a persistent data
structure.

[https://en.wikipedia.org/wiki/Persistent_data_structure](https://en.wikipedia.org/wiki/Persistent_data_structure)

The persistence allows previous states of the data structure to be used in
still ongoing, "older" transactions.

~~~
dominotw
datomic is built on this concept ?

~~~
ysleepy
pretty much. Datomic is roughly what you get if you do MVCC, but never
garbage-collect old entries and support querying at a chosen
version/timestamp.

------
tempguy9999
I really need to understand MVCC but this isn't greatly helpful. It starts
assuming you understand the basics (which is fine, but be aware) but it's
really just a 20% slideshow adjunct to a talk that would fill in the remaining
80%.

~~~
barking
Postgres like most other databases pretty much copied MVCC from
Interbase/Firebird. I found the following explanations for Transactions in
Firebird very helpful in terms of understanding MVCC aka MGA (multi-
generational architecture)

[https://ib-aid.com/en/transactions-in-firebird-acid-isolatio...](https://ib-
aid.com/en/transactions-in-firebird-acid-isolation-levels-deadlocks-and-
update-conflicts-resolution/)

[https://www.slideshare.net/ibsurgeon/3-how-
transactionswork](https://www.slideshare.net/ibsurgeon/3-how-transactionswork)

~~~
eternalban
MVCC was described in detail by David Reed in his 1978 thesis. Everyone
"copied" him. Do you have cites for your assertion that Postgresql copied
Interbase and not read published CS papers on the topic?

The term "MGA" also seems to be a rebranding private to the Interbase universe
so I question that "MVCC aka MGA" bit as well.

~~~
tempguy9999
I looked that up. From
[https://en.wikipedia.org/wiki/InterBase](https://en.wikipedia.org/wiki/InterBase)

"Although InterBase's implementation is much more similar to the system
described by Reed in his MIT dissertation than any other database that existed
at the time and Starkey knew Bernstein from his previous position at the
Computer Corporation of America and later at DEC, Starkey has stated that he
arrived at the idea of multiversion concurrency control independently.[3] In
the same comment, Starkey says:

The inspiration for multi-generational concurrency control was a database
system done by Prime that supported page level snapshots. The intention of the
feature was to give a reader a consistent view of the database without
blocking writers. The idea intrigued me as a very useful characteristic of a
database system."

Seems you're right.

Curiously, I'd assumed before starting to read about MVCC that history was
done at a page level as described above, whereas it seems it's generally done
at the row/tuple level

