O'Reilly logo

PostgreSQL 9 Administration Cookbook - Second Edition by Simon Riggs, Gianni Ciolli, Hannu Krosing, Gabriele Bartolini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collecting regular statistics from pg_stat* views

This recipe describes how to collect the statistics needed to understand what is going on in the database system on a regular basis so that they can be used to further optimize the queries that are slow or are becoming slow as the database changes.

We have included an example of extension, called pgstatslog. It can be used to track these changes. The extension works on PostgreSQL 9.1, 9.2, 9.3 and 9.4.

Porting of this extension to PostgreSQL 9.0 is simple and can be performed as an exercise by you.

Look at the Using an installed module and Managing installed extensions recipes from Chapter 3, Configuration, for an overview of the extensions infrastructure in PostgreSQL.

Further information on extensions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required