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 describingPostgreSQL's statistics collector, but one should not neglect regular Unix monitoring programs such as
vmstat. Also, once one has identified a poorly-performing query, further investigation might be needed usingPostgreSQL'sEXPLAINcommand.Section 14.1discusses
EXPLAINand other methods for understanding the behavior of an individual query.