Because Postgres hasn't adopted that yet, and I'm not aware of any actual plan to adopt it? Tom Lane just did an interview where he said he doesn't see any world where they move away from dead tuples and vacuuming.
The MVCC article is good but feels like it's trying too hard to be a "on one hand, on the other hand" kind of analysis. Postgres is the only database that uses its design because, as the article admits at the end, it has "operationally loud failure modes".
Compare Postgres and Oracle (block undo based) for what happens when the database is underprovisioned:
• Postgres: bottlenecks on CPU. The database falls behind on vacuuming and dies.
• Oracle: bottlenecks on free disk space. Individual long running statements, SNAPSHOT and READ ONLY transactions get cancelled with a "snapshot too old" error.
In Oracle the database continues running and the blast radius is limited to a single statement. Because it's the longest running statements that die first, that almost certainly means an asynchronous business report and not live user traffic - which is exactly what you'd hope for. Most businesses can tolerate a missing day in a report much better than customer-facing outages, and fixing it is just a single SQL statement if you have free disk space (adding more storage is easy due to the SAN).
That's much preferable! How many post mortems do we see on HN from some startup bemoaning a multi-hour outage caused by Postgres' MVCC choices? Quite a lot. Now think about how often do you recall reading a post mortem of an outage at some big bank, hospital, shipping port etc that traces back to Oracle's MVCC engine? I don't think I ever read one. The startup world likes to make fun of Big Enterprise, but they have a much better track record of database uptime because they stay away from vacuum-based MVCC.
Disclosure: I have a part time role in the Oracle DB group. Unapproved opinions may be found above, caveat emptor.
The Postgres approach to MVCC ("append-only storage" in the jargon of https://www.cs.cmu.edu/~pavlo/blog/2023/04/the-part-of-postg...) is mandatory if you actually return object addresses to the client and thus need pointer stability (I've implemented such a DB). However, Postgres doesn't actually have this requirement so it makes little sense in that context. The beauty of undo log-based MVCC is that all versions superseded by a committed transaction are freed at the same time and from the same contiguous region of memory or disk, which makes it both memory- and SSD-friendly ("grouping by death time" in the jargon of https://research.cs.wisc.edu/wind/Publications/nvmw18-he.pdf).
Yes. This is the thing that tripped me the most when learning postgres internals. It was obvious that append-only enabled stable addressing but then it just never materializes. I was incredibly perplexed. Surely I'm missing something right? Nope!
Postgres folks will need to correct me but I believe the append-only MVCC design originated from the original "time-travel" requirement (which IIRC was soon dropped). There are better approaches to time-travel anyway such as time-split B-trees (https://www.microsoft.com/en-us/research/wp-content/uploads/...).
You can do time travel with any MVCC design. Undo logging is well suited to it and Oracle ships several forms of time travelling SQL under the name Flashback.
The simplest form of Flashback just uses the undo logs. Normally undo is deleted once no live transaction uses it, but you can set a retention time to allow SELECT ... AS OF ... queries to go back at least that far.
However, keeping undo logs around forever isn't practical. If you want to go back a year then there's Flashback Time Travel which copies old data into tables in a form that the query engine can use to answer AS OF queries more efficiently.
Yes and that would make sense, and what I would expect, if it were available. I understand it is load-bearing but it is nonetheless surprising that it hasn't been revisited. It is surprising, at least to me, that time-travel never shipped given its feasibility.
The boringsql article was very informative, if you can get past some flourishes typical of a coauthor we all know:
> That's the honest shape of the mitigation: HOT is opportunistic, arrives in steady state rather than on demand, and quietly costs you 30% of your table size in reserved space.
Users of software often do not blindly do, or not do, whatever the upstream open source project does.
OrioleDB is friendlier to SSDs and is de facto "the other" MVCC of Postgres. OrioleDB may be still be "beta" but that hasn't stopped operators/users.
MariaDB has some alternative MVCC, one of them is particularly outstanding.
SSD endurance at scale has on and off been a major concern for me, so I empathize with that. Others deserve to know of OrioleDB, and Postgres more broadly is probably better off for it too.
All of the problems Uber had, could have been solved back then, had they actually asked for help on the mailing list. Several of the issues they had have also been fixed/changed in Postgres itself as a reaction to that discussion.
What Uber posted there did prompt me to investigate the topic of Postgres old MVCC, OrioleDB, and MariaDB's alternative MVCC.
Ultimately, one change in a row results in the entire row being written again, from what I read. Is this not accurate?
MariaDB's MVCC doesn't write the entire row again, only the delta. One of the newer more advanced MVCC for MariaDB are even more efficient.
In my view, "runaway vacuum" has never not been a case of either poorly done IT operations or poorly thought out (or just not thought out) database usage patterns by the in-house application developers. While "throw hardware at the problem" isn't a great answer, I have never not seen NVDIMM for ZFS ZiL/SLOG not mitigate "runaway vacuum", as ugly as that is -- that was a long time ago though.
SSD endurance can get daunting in an advanced hosting environment. It's odd that I don't often see others have these metrics in their Prometheus+Grafana. The people who are telling me that OrioleDB alleviates their endurance concerns aren't at liberty to show me their Grafana.
I might be able to get some real SSD endurance metrics comparisons at meaningful scale over the next couple years but I don't know.
Beyond that, I think the only real way to find out is a snapshot of real-world application production Postgres databases and use logical replication to replay a year of database traffic to find out what the delta on SSD endurance impact is.
I don't claim to be a Postgres expert relative to the upper echelon that frequents this site, always happy to get more insight to Postgres, my attention has generally been on either North or South side of that part of a webscale stack.
It's also hard to even claim they migrated from “PostgreSQL” to “MySQL”; they surely run MySQL underneath in their new system, but it's a really weird hybrid where it's basically only the storage engine. Even secondary indexes, on of their main points of contention in the article, is managed as a separate system on top of the database.
[–] amw-zero 4 days ago
[–] hans_castorp 4 days ago
This article about MVCC is also quite interesting: https://boringsql.com/posts/mvcc-bad-bad/
[–] mike_hearn 4 days ago
Compare Postgres and Oracle (block undo based) for what happens when the database is underprovisioned:
• Postgres: bottlenecks on CPU. The database falls behind on vacuuming and dies.
• Oracle: bottlenecks on free disk space. Individual long running statements, SNAPSHOT and READ ONLY transactions get cancelled with a "snapshot too old" error.
In Oracle the database continues running and the blast radius is limited to a single statement. Because it's the longest running statements that die first, that almost certainly means an asynchronous business report and not live user traffic - which is exactly what you'd hope for. Most businesses can tolerate a missing day in a report much better than customer-facing outages, and fixing it is just a single SQL statement if you have free disk space (adding more storage is easy due to the SAN).
That's much preferable! How many post mortems do we see on HN from some startup bemoaning a multi-hour outage caused by Postgres' MVCC choices? Quite a lot. Now think about how often do you recall reading a post mortem of an outage at some big bank, hospital, shipping port etc that traces back to Oracle's MVCC engine? I don't think I ever read one. The startup world likes to make fun of Big Enterprise, but they have a much better track record of database uptime because they stay away from vacuum-based MVCC.
Disclosure: I have a part time role in the Oracle DB group. Unapproved opinions may be found above, caveat emptor.
[–] senderista 3 days ago
[–] xyzzy_plugh 3 days ago
[–] senderista 3 days ago
[–] mike_hearn 3 days ago
The simplest form of Flashback just uses the undo logs. Normally undo is deleted once no live transaction uses it, but you can set a retention time to allow SELECT ... AS OF ... queries to go back at least that far.
However, keeping undo logs around forever isn't practical. If you want to go back a year then there's Flashback Time Travel which copies old data into tables in a form that the query engine can use to answer AS OF queries more efficiently.
[–] xyzzy_plugh 3 days ago
[–] matharmin 4 days ago
[–] guenthert 4 days ago
[–] akoboldfrying 4 days ago
> That's the honest shape of the mitigation: HOT is opportunistic, arrives in steady state rather than on demand, and quietly costs you 30% of your table size in reserved space.
[–] senderista 3 days ago
[–] jon128 4 days ago
OrioleDB is friendlier to SSDs and is de facto "the other" MVCC of Postgres. OrioleDB may be still be "beta" but that hasn't stopped operators/users.
MariaDB has some alternative MVCC, one of them is particularly outstanding.
SSD endurance at scale has on and off been a major concern for me, so I empathize with that. Others deserve to know of OrioleDB, and Postgres more broadly is probably better off for it too.
[–] hans_castorp 4 days ago
[–] jon128 3 days ago
What Uber posted there did prompt me to investigate the topic of Postgres old MVCC, OrioleDB, and MariaDB's alternative MVCC.
Ultimately, one change in a row results in the entire row being written again, from what I read. Is this not accurate?
MariaDB's MVCC doesn't write the entire row again, only the delta. One of the newer more advanced MVCC for MariaDB are even more efficient.
In my view, "runaway vacuum" has never not been a case of either poorly done IT operations or poorly thought out (or just not thought out) database usage patterns by the in-house application developers. While "throw hardware at the problem" isn't a great answer, I have never not seen NVDIMM for ZFS ZiL/SLOG not mitigate "runaway vacuum", as ugly as that is -- that was a long time ago though.
SSD endurance can get daunting in an advanced hosting environment. It's odd that I don't often see others have these metrics in their Prometheus+Grafana. The people who are telling me that OrioleDB alleviates their endurance concerns aren't at liberty to show me their Grafana.
I might be able to get some real SSD endurance metrics comparisons at meaningful scale over the next couple years but I don't know.
Beyond that, I think the only real way to find out is a snapshot of real-world application production Postgres databases and use logical replication to replay a year of database traffic to find out what the delta on SSD endurance impact is.
I don't claim to be a Postgres expert relative to the upper echelon that frequents this site, always happy to get more insight to Postgres, my attention has generally been on either North or South side of that part of a webscale stack.
[–] Sesse__ 4 days ago
[–] ksec 4 days ago