Chapter 29. Monitoring Database Activity

Table of Contents

29.1. Standard Unix Tools
29.2. The Statistics Collector
29.2.1. Statistics Collection Configuration
29.2.2. Viewing Statistics
29.2.3. Statistics Functions
29.3. Viewing Locks
29.4. Progress Reporting
29.5. Dynamic Tracing
29.5.1. Compiling for Dynamic Tracing
29.5.2. Built-in Probes
29.5.3. Using Probes
29.5.4. Defining New Probes

A database administrator frequently wonders, What is the system doing right now? This chapter discusses how to find that out.

Several tools are available for monitoring database activity and analyzing performance. Most of this chapter is devoted to describing Postgres Pro's statistics collector, but one should not neglect regular Unix monitoring programs such as ps, top, iostat, and vmstat. Also, once one has identified a poorly-performing query, further investigation might be needed using Postgres Pro's EXPLAIN command. Section 14.1 discusses EXPLAIN and other methods for understanding the behavior of an individual query.