Getting ready

We recommend that you check the PostgreSQL documentation for system administration functions and views maintained by the statistics collector. We will be using the pg_relation_filepath function and the pg_stat_user_tables view.

We will also make use of a contributed utility named pgFincore. This utility is not included with standard PostgreSQL, but is often packaged for popular Linux distributions. To install it on an Ubuntu server along with the PostgreSQL server, use this command:

sudo apt-get install postgresql-9.6-pgfincore 

Afterwards, activate it in the database with this query:

CREATE EXTENSION pgfincore; 

For lucky users of 9.4 and above, there's also the option of pg_prewarm. It can be installed with this SQL:

 CREATE ...

Get PostgreSQL High Availability Cookbook - Second Edition 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.