mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-27 14:06:45 +00:00
Change the way the page versions are stored in an in-memory layer. Instead of storing the original PageVersion structs, serialize them into an expandable buffer. That has a couple of advantages: first, the serialized form is more compact, which greatly reduces the memory usage. Secondly, we can track the memory used more accurately. This moves the serialization work from the checkpointer to the WAL receiver. It also means that if a page in an in-memory layer is accessed, it needs to be deserialized on the GetPage call. That's adds a bit of latency, but it's not significant compared to the overhead of replaying WAL records. The simpler memory accounting is worth it. Per Konstantin's idea a long time ago.