O'Reilly logo

PostgreSQL High Performance Cookbook by Dinesh Kumar, Chitij Chauhan

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

Table access statistics

In this recipe, we will be discussing how to study the table access statistics by using PostgreSQL catalog views.

Getting ready

PostgreSQL's statistics collector process keeps track of all kinds of operations that are performing on any table or an index. These statistics will be helpful in determining the importance of an object in the business, and also defines whether the required maintenance operations are running on it when it is required.

How to do it...

Let's create a test table, which we will perform a few operations on:

postgres=# CREATE TABLE test (t INT); 
CREATE TABLE

PostgreSQL provides a few catalog views, which we are going to query to analyze the statistics, which statistics collector process is collected in ...

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