Inside Buffer Cache
Inside Buffer Cache
Greg Smith
Truviso
07/07/2008
cd contrib/pg buffercache
make
make install
psql -d database -f pg buffercache.sql
I You can take a look into the shared buffer cache using the
pg buffercache module
I The 8.3 version includes the usage count information, earlier
versions did not. The patch to add usage count is
simple and applies easily to 8.2 and possibly earlier versions. See
http://archives.postgresql.org/pgsql-patches/2007-03/ms
I for the patch, apply before doing the above
Greg Smith Inside the PostgreSQL Shared Buffer Cache
Limitations of pg buffercache
I You must join against pg class to decode the file this buffer is
caching a block from
I Top 10 tables represented in the cache and how much
memory they have:
I Remember: we only have the information to decode tables in
the current database
Greg Smith Inside the PostgreSQL Shared Buffer Cache
Sample internals output