Inspection of the buffer cache queries

Note that due to multiple changes between PostgreSQL in version 8.3, few of these queries will work without modification on earlier versions. You will have to remove all references to usagecount and, in some cases, may need to adjust how values are cast between types.

For the following examples, in terms of output (which is scripted into the code sample named bufcache.sh included with the book), shared_buffers is set to 256 MB, and pgbench is initialized with a scale of 50 (full coverage of pgbench, another database contrib utility, appears in Chapter 8, Database Benchmarking):

$ pgbench -i -s 50 pgbench $ psql -x -c "select pg_size_pretty(pg_database_size('pgbench')) as db_size" -[ RECORD 1 ]--- db_size ...

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.