Chapter 9. Regular Maintenance

In this chapter, we will cover the following recipes:

  • Controlling automatic database maintenance
  • Avoiding auto-freezing and page corruptions
  • Avoiding transaction wraparound
  • Removing old prepared transactions
  • Actions for heavy users of temporary tables
  • Identifying and fixing bloated tables and indexes
  • Maintaining indexes
  • Adding a constraint without checking existing rows
  • Finding unused indexes
  • Carefully removing unwanted indexes
  • Planning maintenance

Introduction

PostgreSQL prefers regular maintenance, and there is a recipe discussing planning maintenance (the last one).

We recognize that you're here for a reason and are looking for a quick solution to your needs. You're probably thinking, "fix me first, and I'll plan later." So ...

Get PostgreSQL 9 Administration 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.