Preface
3
Chapter 8, Monitoring and Diagnosis, provides recipes that answer questions such as is
the user connected?, what are they running?, are they active or blocked?, who is blocking
them?, is anybody using a specic table?, when did anybody last use it?, how much disk
space is used by temporary data?, and why are my queries slowing down? It also helps you in
investigating and reporting a bug, producing a daily summary report of logle errors, killing a
specic session, and resolving an in-doubt prepared transaction.
Chapter 9, Regular Maintenance, provides useful recipes on 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 xing bloated tables and indexes, maintaining indexes, nding unused indexes, carefully
removing unwanted indexes, and planning maintenance.
Chapter 10, Performance & Concurrency, covers topics such as nding slow SQL statements,
collecting regular statistics from pg_stat* views, nding what makes SQL slow, reducing the
number of rows returned, simplifying complex SQL, speeding up queries without rewriting
them, why is my query not using an index?, how do I force a query to use an index?, using
optimistic locking, and reporting performance problems.
Chapter 11, Backup & Recovery, most people admit that backups are essential, though they
also devote only a very small amount of time to thinking about the topic. So, this chapter
provides useful information about backup and recovery of your PostgreSQL database through
recipes on understanding and controlling crash recovery, planning backups, hot logical
backup of one database, hot logical backup of all databases, hot logical backup of all tables
in a tablespace, backup of database object denitions, standalone hot physical database
backup, hot physical backup & continuous archiving. It also includes topics such as recovery
of all databases, recovery to a point in time, recovery of a dropped/damaged table, recovery
of a dropped/damaged database, recovery of a dropped/damaged tablespace, improving
performance of backup/recovery, and incremental/differential backup and restore.
Chapter 12, Replication & Upgrades, replication isn't magic, though it can be pretty cool. It's
even cooler when it works, and that's what this chapter is all about. This chapter covers topics
such as replication concepts, replication best practices, setting up le-based log shipping
replication, setting up streaming log replication, managing log shipping replication, managing
Hot Standby, selective replication using Londiste 3.0, selective replication using Slony 2.0,
load balancing with pgpool II 3.0, upgrading to a new minor release (for example, 9.0.0 to
9.0.1), in-place major upgrades (for example, 8.4 to 9.0, or 9.0 to 9.1), and major upgrades
online using replication tools.
What you need for this book
We need the following software for this book:
f PostgreSQL 9.0 Server Software
f psql client utility (part of 9.0)
f pgAdmin3 1.12