There's more…

There is an extension called pgfincore that implements a set of functions to manage PostgreSQL data pages in the operating system's file cache. One possible use is to preload some tables so that PostgreSQL will load them faster when requested. The general idea is that you can provide more detailed information for the operating system cache, which can therefore behave more efficiently.

The pgfincore extension is a stable project started in 2009. More details about it are available at http://pgfoundry.org/projects/pgfincore, including the source code. However, it should be noted that most distributions include a prebuilt pgfincore package, which makes installation easier.

There is also a contrib module called pg_prewarm, introduced in PostgreSQL 9.4, which addresses a similar problem. While there is some overlapping with pgfincore, the feature sets are not the same; for instance, pgfincore can operate on files not in the shared buffer cache, and can also preload full relations with only a few system calls, taking into account the existing cache; on the other hand, pg_prewarm can operate on the PostgreSQL shared buffer cache, and it also works on Windows.