The first thing you really have to learn about is understanding what PostgreSQL's onboard statistics have got to offer and using them. In my personal opinion, there is no way to improve performance and reliability without collecting the necessary data to make prudent decisions.
This section will guide you through PostgreSQL's runtime statistics and explain how you can extract more runtime information from your database setups.