O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

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

Identifying and fixing bloated tables and indexes

PostgreSQL implements MVCC (Multi-Version Concurrency Control), that allows users to read data at the same time as writers make changes. This is an important feature for concurrency in database applications, as it can allow the following:

  • Better performance because of fewer locks
  • Greatly reduced deadlocking
  • Simplified application design and management

MVCC is a core part of PostgreSQL and cannot be turned off, nor would you really want it to be. The internals of MVCC have some implications for the DBA that need to be understood. The price for these benefits is that SQL UPDATE command can cause tables and indexes to grow in size because they leave behind dead row versions. DELETEs and aborted INSERTs ...

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