Determining disk usage

In this recipe, we will be discussing the PostgreSQL functionality that measures object size.

Getting ready

PostgreSQL follows a specific file storage layout, which stores data into multiple folders. The common directories that we see in the PostgreSQL data directory are:

  • base: This folder contains the database subfolders and the subfolder will contain actual relational files
  • global: This folder contains all the cluster level catalog information
  • pg_clog: This folder contains the committed transactions information, which will be helpful during crash recovery
  • pg_xlog: This folder contains the ongoing transactions information, which will be helpful during crash recovery
  • pg_tblsp: This folder contains the symbolic link to tablespaces ...

Get PostgreSQL High Performance Cookbook 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.