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