In this post we’ll cover two types of Postgres internals. The first internal item is an “SLRU.” The acronym stands for “simple least recently used.” The LRU portion refers to caches and how they work, and SLRUs in Postgres are a collection of these caches. SLRUs are small in-memory item stores. Since they need to persist across restarts, they’re also saved into files on disk. Alvaro1 calls SLRUs “poorly named” for a user-facing feature. If they’re internal, why are they worth knowing about as Postgres users? They’re worth knowing about because there can be a couple of possible failure points with them, due their fixed size. We’ll look at those later in this post. Before getting into that, let’s cover some basics about what they are and look at a specific type. Main purpose of SLRUs The main purpose of SLRUs is to track metadata about Postgres transactions. SLRUs are a general mechanism used by multiple types. Like a lot of things in Postgres, the SLRU system is extensible which means…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.