Re: SLRU - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Re: SLRU
Date
Msg-id CABOikdNqOXAsdPwR3NVTCKAu09PgtA2WsAzvGsS8VRri=AS0sw@mail.gmail.com
Whole thread Raw
In response to SLRU  (Soroosh Sardari <soroosh.sardari@gmail.com>)
List pgsql-hackers




On Mon, Jun 17, 2013 at 1:22 PM, Soroosh Sardari <soroosh.sardari@gmail.com> wrote:
Hey

I was reading the multi transaction log manager, multixact.c.
I didn't get what  SLRU does.

I want the goal of this module, and why we use it.
I'm kind of newbie, be patient with me ;)


Did you look at src/backend/access/transam/slru.c ? The first para in that file is quite explanatory:

* We use a simple least-recently-used scheme to manage a pool of page
 * buffers.  Under ordinary circumstances we expect that write
 * traffic will occur mostly to the latest page (and to the just-prior
 * page, soon after a page transition).  Read traffic will probably touch
 * a larger span of pages, but in any case a fairly small number of page
 * buffers should be sufficient.  So, we just search the buffers using plain
 * linear search; there's no need for a hashtable or anything fancy.
 * The management algorithm is straight LRU except that we will never swap
 * out the latest page (since we know it's going to be hit again eventually).

Thanks,
Pavan
 
--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee

pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: Patch for fail-back without fresh backup
Next
From: Dimitri Fontaine
Date:
Subject: Re: Hard limit on WAL space used (because PANIC sucks)